Free CAT library

Power-of-Two Base Grouping Shortcuts

Exploit isomorphic power-of-two base relations (Base 2, 4, 8, 16) to execute direct inter-base conversions via bit-grouping (triplets and nibbles) and proper directional padding, completely bypassing decimal arithmetic.

1. The Story & Mental Model: The Software Engineer's Hexadecimal Glasses

In modern computing, the central processing unit (CPU) operates exclusively with transistors that can only be ON (11) or OFF (00). A 32-bit memory address in raw binary looks like this:

11010111101000101111000011001110

For a software engineer or systems architect, reading a 32-character string of 1s and 0s is an ocular nightmare—transposing a single 0 for a 1 creates catastrophic bugs. But notice a fundamental mathematical coincidence:

16=24and8=2316 = 2^4 \quad \text{and} \quad 8 = 2^3

Because 1616 is an exact integer power of 22, every bundle of exactly 44 binary bits corresponds to one and only one hexadecimal symbol. That unreadable 32-bit binary string collapses into eight clean characters:

D 7 A 2 F 0 C E

No arithmetic division or polynomial multiplication is required. It is pure isomorphic symbol substitution. Hexadecimal and octal are not separate arithmetic systems; they are merely human-readable compact lenses for raw binary!


2. The CAT Question Blueprint: How Power-Base Grouping is Tested

CAT questions test your ability to avoid unnecessary decimal computation. Look for these standard question patterns:

  1. Large Binary to Octal / Hexadecimal Conversion: A 15- to 24-digit binary number is presented. Students who convert to decimal first waste 5 minutes and make arithmetic errors; students who group bits solve it in 15 seconds.

  2. The Octal-to-Hex Transcoding Shortcut: Converting an octal number (7653)8(7653)_8 to hexadecimal. The optimal path is Octal →\to 3-bit Binary →\to 4-bit Hexadecimal, entirely bypassing base 10.

  3. The Fractional Padding Direction Trap: A fractional binary number like (0.10111)2(0.10111)_2 must be converted to octal. Students group from the wrong direction or pad on the left of the decimal point, corrupting place values.

  4. General Power-Base Mappings (2a→2b2^a \to 2^b): Converting base 44 (222^2) to base 88 (232^3), requiring bit expansion followed by regrouping.


3. Core Concepts, Formulae & Derivations

A. The Power-Base Grouping Principle

Let r1r_1 and r2r_2 be two radices such that r2=r1kr_2 = r_1^k for some positive integer k∈Z+k \in \mathbb{Z}^+.

Then every single digit in base r2r_2 corresponds to exactly kk consecutive digits in base r1r_1.

2^1 = 2 &\implies 1 \text{ bit in Base 2} \\ 2^2 = 4 &\implies 2 \text{ bits per Quaternary digit} \\ 2^3 = 8 &\implies 3 \text{ bits per Octal digit (triplet)} \\ 2^4 = 16 &\implies 4 \text{ bits per Hexadecimal digit (nibble)} \end{aligned}$$ #### B. Directional Grouping from the Radix Point The radix point acts as the universal anchor for bit grouping: $$\dots \xleftarrow{\text{Group LEFTWARDS (pad with leading zeros)}} \mathbf{[Integer]} \; . \; \mathbf{[Fraction]} \xrightarrow{\text{Group RIGHTWARDS (pad with trailing zeros)}} \dots$$ - **For the integer part:** Group bits in chunks of $k$ moving **leftward** from the radix point. If the leftmost group has fewer than $k$ bits, pad it with **leading zeros** on the far left. - **For the fractional part:** Group bits in chunks of $k$ moving **rightward** from the radix point. If the rightmost group has fewer than $k$ bits, pad it with **trailing zeros** on the far right. #### C. The Canonical Binary-Octal-Hexadecimal Conversion Table $$\begin{array}{|c|c||c|c|} \hline \textbf{Binary (3-bit)} & \textbf{Octal (Base 8)} & \textbf{Binary (4-bit)} & \textbf{Hexadecimal (Base 16)} \\ \hline 000 & 0 & 0000 & 0 \\ 001 & 1 & 0001 & 1 \\ 010 & 2 & 0010 & 2 \\ 011 & 3 & 0011 & 3 \\ 100 & 4 & 0100 & 4 \\ 101 & 5 & 0101 & 5 \\ 110 & 6 & 0110 & 6 \\ 111 & 7 & 0111 & 7 \\ - & - & 1000 & 8 \\ - & - & 1001 & 9 \\ - & - & 1010 & \text{A } (10) \\ - & - & 1011 & \text{B } (11) \\ - & - & 1100 & \text{C } (12) \\ - & - & 1101 & \text{D } (13) \\ - & - & 1110 & \text{E } (14) \\ - & - & 1111 & \text{F } (15) \\ \hline \end{array}$$ #### D. The Octal-Hex Direct Transit Protocol To convert $(N)_8 \to (N)_{16}$ directly without decimal intervention: $$\mathbf{(N)_8 \xrightarrow{\text{Expand each digit to 3 bits}} \text{Bitstream } (N)_2 \xrightarrow{\text{Regroup into 4-bit nibbles}} (N)_{16}}$$ --- ### 4. Common Pitfalls & Speed Shortcuts > [!CAUTION] > **The Fractional Padding Disaster:** > Consider converting $(0.1)_2$ to octal. > - *Wrong:* The student thinks $0.1_2$ has one digit, so they write $(0.1)_8$. > - *Right:* Moving rightward from the radix point, the first group is `1`. To make it a 3-bit triplet, pad with zeros to the **RIGHT**: `100`. > - `100_2 = 4`, so $(0.1)_2 = (0.4)_8$! > - *Check:* $(0.1)_2 = \frac{1}{2}$, and $(0.4)_8 = \frac{4}{8} = \frac{1}{2}$. Math never lies! > [!TIP] > **Octal to Hex in 10 Seconds:** > Never go $(N)_8 \to (N)_{10} \to (N)_{16}$! > For $(752)_8$: > - Write 3 bits each: `111 101 010` > - Regroup into 4s from right: `0001 1110 1010` > - Read hex: `1 E A` $\implies (1\text{EA})_{16}$. Solved!

Formulas

Logarithmic Grouping Theorem

r2=r1k  ⟹  1 digit of r2≡k digits of r1r_2 = r_1^k \implies 1 \text{ digit of } r_2 \equiv k \text{ digits of } r_1

Exact power-of-two base grouping ratio (k=3 for octal, k=4 for hex)
Integer Grouping Direction

⋯←leftward from radix pointa2a1a0\dots \xleftarrow{\text{leftward from radix point}} a_2 a_1 a_0

Group leftward; pad leading zeros on the far left of the integer part
Fractional Grouping Direction

b1b2b3⋯→rightward from radix pointb_1 b_2 b_3 \dots \xrightarrow{\text{rightward from radix point}}

Group rightward; pad trailing zeros on the far right of the fractional part
Octal-to-Hex Transcoding Bridge

(N)8→3-bit unpack(N)2→4-bit pack(N)16(N)_8 \xrightarrow{\text{3-bit unpack}} (N)_2 \xrightarrow{\text{4-bit pack}} (N)_{16}

Converts directly between octal and hex without evaluating decimal values

Traps and tips

  • Fractional padding rule: Always pad trailing zeros to the RIGHT of fractional groups, never to the left.
  • Octal to Hex shortcut: Expand octal digits into 3 binary bits each, then group the resulting bitstream into 4-bit nibbles from the radix point.
  • Bit count shortcut: An n-hex-digit number occupies at most 4n bits; inspect the most significant hex digit to get the exact bit count.
  • Base 4 to Base 8: Expand each base-4 digit into 2 bits, then group the bitstream into 3-bit triplets.

Solved examples

Example 2.2.1: Large Binary to Hexadecimal via 4-Bit Nibbles

A microcontroller program counter holds the 14-bit binary memory address (11010111101100)2(11010111101100)_2. Transcode this address directly into hexadecimal notation.

Show solution

Step 1: Anchor at the radix point and group leftwards in 4-bit nibbles.

The binary integer has 14 bits:

11⏟2 bits remaining0101⏟nibble 21110⏟nibble 11100⏟nibble 0\underbrace{11}_{\text{2 bits remaining}} \quad \underbrace{0101}_{\text{nibble 2}} \quad \underbrace{1110}_{\text{nibble 1}} \quad \underbrace{1100}_{\text{nibble 0}}

Step 2: Pad the leftmost incomplete group with leading zeros.

Pad 11 with two leading zeros to complete a 4-bit nibble: 0011.

The formatted 4-bit groups become:

(0011010111101100)2(0011 \quad 0101 \quad 1110 \quad 1100)_2

Step 3: Convert each nibble into its hexadecimal symbol.

  • 00112=2+1=30011_2 = 2 + 1 = 3

  • 01012=4+1=50101_2 = 4 + 1 = 5

  • 11102=8+4+2=14=E1110_2 = 8 + 4 + 2 = 14 = \text{E}

  • 11002=8+4=12=C1100_2 = 8 + 4 = 12 = \text{C}

Concatenate the hexadecimal symbols:

(11010111101100)2=(35EC)16(11010111101100)_2 = (35\text{EC})_{16}

Verification via Decimal:

3⋅163+5⋅162+14⋅161+12=3(4,096)+5(256)+224+12=12,288+1,280+236=13,804103 \cdot 16^3 + 5 \cdot 16^2 + 14 \cdot 16^1 + 12 = 3(4,096) + 5(256) + 224 + 12 = 12,288 + 1,280 + 236 = 13,804_{10}.

Binary value: 213+212+210+28+27+26+25+23+22=8192+4096+1024+256+128+64+32+8+4=13,804102^{13} + 2^{12} + 2^{10} + 2^8 + 2^7 + 2^6 + 2^5 + 2^3 + 2^2 = 8192 + 4096 + 1024 + 256 + 128 + 64 + 32 + 8 + 4 = 13,804_{10}. Matches!

Takeaway: Group binary bits in chunks of 4 from the decimal point moving left, padding the leftmost chunk with leading zeros.

Example 2.2.2: Binary to Octal via 3-Bit Triplets

Convert the same 14-bit binary memory address (11010111101100)2(11010111101100)_2 directly into octal (base 8) notation.

Show solution

Step 1: Anchor at the units place and group leftwards in 3-bit triplets.

The 14 bits are partitioned from right to left in groups of 3:

11⏟2 bits010⏟triplet 3111⏟triplet 2101⏟triplet 1100⏟triplet 0\underbrace{11}_{\text{2 bits}} \quad \underbrace{010}_{\text{triplet 3}} \quad \underbrace{111}_{\text{triplet 2}} \quad \underbrace{101}_{\text{triplet 1}} \quad \underbrace{100}_{\text{triplet 0}}

Step 2: Pad the leftmost group with a leading zero.

Pad 11 with one leading zero to make 011:

(011010111101100)2(011 \quad 010 \quad 111 \quad 101 \quad 100)_2

Step 3: Convert each 3-bit triplet to its octal digit.

  • 0112=2+1=3011_2 = 2 + 1 = 3

  • 0102=2010_2 = 2

  • 1112=4+2+1=7111_2 = 4 + 2 + 1 = 7

  • 1012=4+1=5101_2 = 4 + 1 = 5

  • 1002=4100_2 = 4

Concatenate the octal digits:

(11010111101100)2=(32754)8(11010111101100)_2 = (32754)_8

Verification via Decimal:

3⋅84+2⋅83+7⋅82+5⋅81+4⋅803 \cdot 8^4 + 2 \cdot 8^3 + 7 \cdot 8^2 + 5 \cdot 8^1 + 4 \cdot 8^0

=3(4,096)+2(512)+7(64)+40+4= 3(4,096) + 2(512) + 7(64) + 40 + 4

=12,288+1,024+448+44=13,80410= 12,288 + 1,024 + 448 + 44 = 13,804_{10}

Exact agreement with Example 2.2.1!

Takeaway: Because 8 = 2^3, octal conversion requires grouping into 3-bit triplets from the radix point leftwards.

Example 2.2.3: Octal to Hexadecimal Direct Bridge via Binary Bitstream

Convert the octal numeral (6735)8(6735)_8 directly into hexadecimal without calculating its decimal value at any intermediate stage.

Show solution

Step 1: Unpack each octal digit into its exact 3-bit binary triplet.

6 &\to 110 \\ 7 &\to 111 \\ 3 &\to 011 \\ 5 &\to 101 \end{aligned}$$ Concatenate to form the full 12-bit binary stream: $$(6735)_8 = (110 \; 111 \; 011 \; 101)_2 = (110111011101)_2$$ **Step 2: Regroup the 12-bit stream into 4-bit nibbles from right to left.** Partition into chunks of 4: $$(1101 \quad 1101 \quad 1101)_2$$ **Step 3: Translate each 4-bit nibble into hexadecimal.** - $1101_2 = 8 + 4 + 0 + 1 = 13 = \text{D}$ - $1101_2 = 8 + 4 + 0 + 1 = 13 = \text{D}$ - $1101_2 = 8 + 4 + 0 + 1 = 13 = \text{D}$ Concatenate the hex digits: $$(6735)_8 = (\text{DDD})_{16}$$ **Verification:** $(\text{DDD})_{16} = 13 \times 16^2 + 13 \times 16^1 + 13 = 13(256 + 16 + 1) = 13(273) = 3,549_{10}$. $(6735)_8 = 6(512) + 7(64) + 3(8) + 5 = 3,072 + 448 + 24 + 5 = 3,549_{10}$. Flawless!

Takeaway: Bypass base 10 completely: unpack octal to 3-bit binary, then pack binary into 4-bit hex nibbles.

Example 2.2.4: Fractional Bit Grouping and Right-Padding Mechanics

Convert the fractional binary value (0.1010111)2(0.1010111)_2 into: (a) octal notation, and (b) hexadecimal notation. Show clearly how padding zeros must be positioned.

Show solution

Part (a): Octal Conversion (3-Bit Groups Rightwards)

Start at the radix point and group bits moving strictly rightward:

(0.101⏟group 1  011⏟group 2  1⏟incomplete)2(0 . \underbrace{101}_{\text{group 1}} \; \underbrace{011}_{\text{group 2}} \; \underbrace{1}_{\text{incomplete}})_2

The third group contains only the single bit 1. We must pad it with two trailing zeros on the right to make a full 3-bit triplet: 100.

(0.101011100)2(0 . 101 \quad 011 \quad 100)_2

Convert each triplet:

  • 1012=5101_2 = 5

  • 0112=3011_2 = 3

  • 1002=4100_2 = 4

Therefore:

(0.1010111)2=(0.534)8(0.1010111)_2 = (0.534)_8

Part (b): Hexadecimal Conversion (4-Bit Groups Rightwards)

Start at the radix point and group bits moving strictly rightward:

(0.1010⏟nibble 1  111⏟incomplete)2(0 . \underbrace{1010}_{\text{nibble 1}} \; \underbrace{111}_{\text{incomplete}})_2

The second group contains three bits 111. We must pad it with one trailing zero on the right to complete the 4-bit nibble: 1110.

(0.10101110)2(0 . 1010 \quad 1110)_2

Convert each nibble:

  • 10102=10=A1010_2 = 10 = \text{A}

  • 11102=14=E1110_2 = 14 = \text{E}

Therefore:

(0.1010111)2=(0.AE)16(0.1010111)_2 = (0.\text{AE})_{16}

Verification:

Value in decimal: 12+18+132+164+1128=64+16+4+2+1128=87128\frac{1}{2} + \frac{1}{8} + \frac{1}{32} + \frac{1}{64} + \frac{1}{128} = \frac{64 + 16 + 4 + 2 + 1}{128} = \frac{87}{128}.

(0.534)8=58+364+4512=320+24+4512=348512=87128(0.534)_8 = \frac{5}{8} + \frac{3}{64} + \frac{4}{512} = \frac{320 + 24 + 4}{512} = \frac{348}{512} = \frac{87}{128}.

(0.AE)16=1016+14256=160+14256=174256=87128(0.\text{AE})_{16} = \frac{10}{16} + \frac{14}{256} = \frac{160 + 14}{256} = \frac{174}{256} = \frac{87}{128}. All three match exactly!

Takeaway: Fractional bits must be grouped moving rightward from the radix point, and padding zeros must always be added to the far right.

Example 2.2.5: General Power-Base Bridging: Base 4 to Base 8

A digital sensor transmits telemetry encoded in quaternary (base 4) notation as (32103)4(32103)_4. Transcode this measurement directly into octal (base 8).

Show solution

Step 1: Identify the power relationship between radices.

4=22  ⟹  1 quaternary digit =2 binary bits4 = 2^2 \implies 1 \text{ quaternary digit } = 2 \text{ binary bits}

8=23  ⟹  1 octal digit =3 binary bits8 = 2^3 \implies 1 \text{ octal digit } = 3 \text{ binary bits}

Step 2: Expand each base-4 digit into a 2-bit binary pair.

3 &\to 11 \\ 2 &\to 10 \\ 1 &\to 01 \\ 0 &\to 00 \\ 3 &\to 11 \end{aligned}$$ Concatenate to yield the 10-bit binary stream: $$(32103)_4 = (11 \; 10 \; 01 \; 00 \; 11)_2 = (1110010011)_2$$ **Step 3: Regroup into 3-bit triplets from the right.** Starting from the units place and moving leftward: $$\underbrace{1}_{\text{1 bit}} \quad \underbrace{110}_{\text{triplet 2}} \quad \underbrace{010}_{\text{triplet 1}} \quad \underbrace{011}_{\text{triplet 0}}$$ Pad the leftmost single bit `1` with two leading zeros: `001`. $$(001 \quad 110 \quad 010 \quad 011)_2$$ **Step 4: Translate each 3-bit triplet into octal.** - $001_2 = 1$ - $110_2 = 4 + 2 = 6$ - $010_2 = 2$ - $011_2 = 2 + 1 = 3$ Result: $$(32103)_4 = (1623)_8$$ **Verification:** $(32103)_4 = 3(256) + 2(64) + 1(16) + 0(4) + 3 = 768 + 128 + 16 + 3 = 915_{10}$. $(1623)_8 = 1(512) + 6(64) + 2(8) + 3 = 512 + 384 + 16 + 3 = 915_{10}$. Exact!

Takeaway: To bridge Base 2^a to Base 2^b, unpack into a-bit pieces and repack into b-bit pieces from the radix point.

Example 2.2.6: Determining Exact Bit-Lengths and Octal Digits from Hexadecimal

A cryptographic hash output begins with the hexadecimal prefix (4A7F0C)16(4\text{A}7\text{F}0\text{C})_{16}. Determine: (a) the exact number of bits required to represent this integer in binary without leading zeros, and (b) the exact number of octal digits required to represent it.

Show solution

Step 1: Analyze the binary structure via 4-bit nibbles.

The hexadecimal number has 66 digits:

4,A,7,F,0,C4, \quad \text{A}, \quad 7, \quad \text{F}, \quad 0, \quad \text{C}

Every digit except possibly the most significant digit (MSD) contributes exactly 44 bits.

The 55 lower hex digits (A7F0C) contribute:

5×4=20 binary bits5 \times 4 = 20 \text{ binary bits}

Step 2: Inspect the most significant hexadecimal digit (44).

Convert 44 to binary: 416=010024_{16} = 0100_2.

Without leading zeros, the number 44 begins at the bit 100, which contains 3 bits (the leading zero is discarded).

Step 3: Calculate the total binary bit count.

Total Bits=3+20=23 bits\text{Total Bits} = 3 + 20 = \mathbf{23 \text{ bits}}

Step 4: Calculate the required number of octal digits.

Each octal digit accommodates up to 33 bits.

The number of octal digits needed to encode 2323 bits is:

⌈233⌉=⌈7.67⌉=8 octal digits\left\lceil \frac{23}{3} \right\rceil = \left\lceil 7.67 \right\rceil = \mathbf{8 \text{ octal digits}}

Verification via Inequalities:

Notice that 222≤N<2232^{22} \le N < 2^{23} because the binary string has 2323 bits.

In octal: 87=2218^7 = 2^{21} and 88=2248^8 = 2^{24}.

Since 221<222≤N<223<882^{21} < 2^{22} \le N < 2^{23} < 8^8, NN strictly satisfies 87≤N<888^7 \le N < 8^8, which proves it has exactly 88 octal digits!

Takeaway: To find the exact binary bit length of a hex integer, expand the leading hex digit without leading zeros and add 4 bits for each subsequent hex digit.

Practice questions

Question 1 · CAT Level

Let XX be the fractional value represented in quaternary (base 44) as X=(0.3213)4X = (0.3213)_4. When XX is directly converted into hexadecimal, it is (0.H1H2)16(0.H_1 H_2)_{16}, and when converted into octal, it is (0.O1O2O3)8(0.O_1 O_2 O_3)_8. Taking standard values for hexadecimal letters (A=10,…,F=15\text{A}=10, \dots, \text{F}=15), what is the value of (H1⋅H2)−(O1⋅O2⋅O3)(H_1 \cdot H_2) - (O_1 \cdot O_2 \cdot O_3)?

  1. A

    4848

  2. B

    6464

  3. C

    5656

  4. D

    3636

Show answer and explanation

Answer: (C) 56

Each quaternary digit converts directly to 22 binary bits: 3→113 \to 11, 2→102 \to 10, 1→011 \to 01, 3→113 \to 11, producing the binary fraction (0.11100111)2(0.11100111)_2.

To convert to hexadecimal (base 16=2416 = 2^4), group the 88 bits into 44-bit nibbles moving rightwards: 11102=14=E161110_2 = 14 = \text{E}_{16} and 01112=70111_2 = 7, yielding (0.E7)16(0.\text{E}7)_{16} with H1=14,H2=7H_1 = 14, H_2 = 7.

To convert to octal (base 8=238 = 2^3), group bits rightwards in 33-bit triplets, appending a padding zero to the right: (0.111⏟7001⏟1110⏟6)2(0.\underbrace{111}_{7}\underbrace{001}_{1}\underbrace{110}_{6})_2.

This yields the octal representation (0.716)8(0.716)_8, so O1=7,O2=1,O3=6O_1 = 7, O_2 = 1, O_3 = 6.

Evaluating the required expression: (H1⋅H2)−(O1⋅O2⋅O3)=(14⋅7)−(7⋅1⋅6)=98−42=56(H_1 \cdot H_2) - (O_1 \cdot O_2 \cdot O_3) = (14 \cdot 7) - (7 \cdot 1 \cdot 6) = 98 - 42 = 56.

Question 2 · CAT Level

A positive integer NN has a 2525-digit hexadecimal representation whose most significant (leading) digit is 77. When NN is written in binary (without leading zeros), it has BB bits, and when written in octal (without leading zeros), it has OO digits. What is the value of B+OB + O?

  1. A

    134134

  2. B

    132132

  3. C

    133133

  4. D

    130130

Show answer and explanation

Answer: (B) 132

The leading hexadecimal digit is 716=011127_{16} = 0111_2, which contributes exactly 33 significant bits (1112111_2) without leading zeros.

Each of the remaining 2424 hexadecimal digits contributes exactly 44 binary bits, yielding a total bit-length of B=3+24⋅4=99B = 3 + 24 \cdot 4 = 99 bits.

Mathematically, 298≤7⋅1624≤N<8⋅1624=2992^{98} \le 7 \cdot 16^{24} \le N < 8 \cdot 16^{24} = 2^{99}, confirming that NN requires precisely 9999 binary bits.

For octal (base 8=238 = 2^3), each octal digit represents a 33-bit group; hence, an integer with BB significant bits requires O=⌈B/3⌉O = \lceil B / 3 \rceil digits.

With B=99B = 99, we have O=⌈99/3⌉=33O = \lceil 99 / 3 \rceil = 33 octal digits (since 832≤N<8338^{32} \le N < 8^{33}).

Therefore, the required sum is B+O=99+33=132B + O = 99 + 33 = 132.

Question 3 · CAT Level

Let SS be the repeating binary fraction (0.101100‾)2(0.\overline{101100})_2. When converted directly into hexadecimal with minimal period length, S=(0.H1H2…Hm‾)16S = (0.\overline{H_1 H_2 \dots H_m})_{16}, where each HiH_i is a hexadecimal digit (A=10,…,F=15\text{A}=10, \dots, \text{F}=15). What is the numerical sum of the digits in the minimal hexadecimal repeating block, ∑i=1mHi\sum_{i=1}^m H_i?

  1. A

    2323

  2. B

    2121

  3. C

    2727

  4. D

    2525

Show answer and explanation

Answer: (D) 25

The repeating binary block 1011002101100_2 has a length of 66 bits.

Hexadecimal digits correspond to 44-bit nibbles; since lcm⁡(6,4)=12\operatorname{lcm}(6, 4) = 12, the minimal repeating block in binary that aligns with whole hexadecimal digits must repeat twice: 1011001011002101100101100_2.

Partitioning this 1212-bit stream into 44-bit nibbles from left to right yields: 10112=B16=111011_2 = \text{B}_{16} = 11, 00102=216=20010_2 = 2_{16} = 2, and 11002=C16=121100_2 = \text{C}_{16} = 12.

Thus, S=(0.B2C‾)16S = (0.\overline{\text{B}2\text{C}})_{16} with minimal period length m=3m = 3.

The sum of these hexadecimal digits is ∑i=13Hi=11+2+12=25\sum_{i=1}^3 H_i = 11 + 2 + 12 = 25.

Question 4 · CAT Level

A positive integer NN is written in quaternary (base 44) as the 1212-digit numeral N=(312023011232)4N = (312023011232)_4. Let WW be the number of set bits (11s) in the binary representation of NN, and let DD be the most significant (leading) octal digit of NN. What is the ordered pair (W,D)(W, D)?

  1. A

    (13,6)(13, 6)

  2. B

    (13,3)(13, 3)

  3. C

    (14,6)(14, 6)

  4. D

    (12,7)(12, 7)

Show answer and explanation

Answer: (A) (13, 6)

Each quaternary digit maps to a 22-bit binary string: 0→000 \to 00 (00 ones), 1→011 \to 01 (11 one), 2→102 \to 10 (11 one), and 3→113 \to 11 (22 ones).

In N=(312023011232)4N = (312023011232)_4, the frequencies of digits are: three 33s, four 22s, three 11s, and two 00s.

The total number of set bits (Hamming weight WW) in binary is W=3(2)+4(1)+3(1)+2(0)=6+4+3+0=13W = 3(2) + 4(1) + 3(1) + 2(0) = 6 + 4 + 3 + 0 = 13.

The total bit-length of NN is 12×2=2412 \times 2 = 24 bits, which divides evenly into 24/3=824 / 3 = 8 octal triplets without requiring padding.

The most significant 33 bits of the binary expansion come from the first two quaternary digits 314→1101231_4 \to 1101_2, so the leading 33-bit triplet is 1102=68110_2 = 6_8.

Therefore, the ordered pair is (W,D)=(13,6)(W, D) = (13, 6).

Question 5 · CAT Level

A positive integer NN is written in binary. When grouped into 33-bit triplets, its octal representation is a 33-digit palindrome (aba)8(aba)_8. When grouped into 44-bit nibbles, its hexadecimal representation is a 22-digit number with identical digits (cc)16(cc)_{16}. If a,b,ca, b, c are non-zero digits and a≠ba \ne b, what is the decimal value of NN?

  1. A

    187187

  2. B

    153153

  3. C

    170170

  4. D

    204204

Show answer and explanation

Answer: (C) 170

A 33-digit octal palindrome has the value N=(aba)8=64a+8b+a=65a+8bN = (aba)_8 = 64a + 8b + a = 65a + 8b, where 1≤a≤71 \le a \le 7 and 1≤b≤71 \le b \le 7.

A 22-digit hexadecimal number with identical digits has the value N=(cc)16=16c+c=17cN = (cc)_{16} = 16c + c = 17c, where 1≤c≤151 \le c \le 15.

Equating the two expressions gives 65a+8b=17c65a + 8b = 17c; since c≤15c \le 15, we have N=17c≤255N = 17c \le 255, which forces a≤3a \le 3.

Rearranging for bb gives 8b=17c−65a8b = 17c - 65a; since 1≤b≤71 \le b \le 7, we require 8≤17c−65a≤568 \le 17c - 65a \le 56.

Testing a=1,2,3a = 1, 2, 3, only a=2a = 2 yields an integer solution: for c=10c = 10, 8b=170−130=40  ⟹  b=58b = 170 - 130 = 40 \implies b = 5.

This gives the unique solution (a,b,c)=(2,5,10)(a, b, c) = (2, 5, 10), corresponding to the decimal value N=17(10)=170N = 17(10) = 170 (binary 101010102=(252)8=(AA)1610101010_2 = (252)_8 = (\text{AA})_{16}).

Study this concept with interactive practice in PrepSoc.

Open the concept library