Number System in Digital Electronics: Base Conversion, Complements and Binary Arithmetic

Learn one dependable method for positional values, decimal fractions, binary grouping, complements, subtraction and signed overflow, with every step checked.

KnowledgeGate Team

Exam prep & CS education

Updated 18 Aug 20266 min read

Learners often memorise separate rules for binary, octal and hexadecimal, then lose marks when a question mixes a fraction, fixed bit width and signed arithmetic. Begin instead with positional value and preserve it through every conversion. One rule, digit times place weight, generates the rest: divide and take remainders for an integer, multiply and take carries for a fraction, group three bits for octal and four for hexadecimal, and invert and add one to turn subtraction into addition. No conversion table is needed at any step.

A number system with base r permits digits from 0 to r - 1. Binary permits only 0 and 1. (101101.01)_2 is valid, while (10201)_2 is invalid because digit 2 does not exist in base 2.

The value of a numeral is N = Σ(d_i × r^i). Positions to the left of the radix point use non-negative powers, and positions to the right use negative powers. For example:

(110101.011)_2

= 1×2^5 + 1×2^4 + 1×2^2 + 1×2^0 + 1×2^-2 + 1×2^-3

= 32 + 16 + 4 + 1 + 0.25 + 0.125

= (53.375)_10

The radix point merely separates the two sets of powers.

Convert decimal integers and fractions without guesswork

For an integer, repeatedly divide by the target base. Each division reveals the current least significant digit, so read remainders bottom-up. For a fraction, repeatedly multiply by the target base. Each multiplication reveals the next digit after the radix point, so read integer parts top-down.

Convert (753.625)_10 to binary. The integer part gives:

Division

Quotient

Remainder

753 ÷ 2

376

1

376 ÷ 2

188

0

188 ÷ 2

94

0

94 ÷ 2

47

0

47 ÷ 2

23

1

23 ÷ 2

11

1

11 ÷ 2

5

1

5 ÷ 2

2

1

2 ÷ 2

1

0

1 ÷ 2

0

1

Reading upward gives 1011110001. Now convert the fraction:

  • 0.625 × 2 = 1.25, so the first digit is 1 and the new fraction is 0.25.

  • 0.25 × 2 = 0.5, so the next digit is 0 and the new fraction is 0.5.

  • 0.5 × 2 = 1.0, so the final digit is 1 and the process stops.

Therefore, (753.625)_10 = (1011110001.101)_2. Expanding the result verifies it: 512 + 128 + 64 + 32 + 16 + 1 + 1/2 + 1/8 = 753.625.

Converting decimal 753.625 to binary by dividing the integer by 2 and multiplying the fraction, giving 1011110001.101.

Use grouping for binary, octal and hexadecimal

Group binary in threes for octal and fours for hexadecimal. Start at the radix point and pad only at the outside edges.

For the same value, octal grouping is 1 011 110 001 . 101, which gives (1361.5)_8. Hexadecimal grouping is 0010 1111 0001 . 1010, which gives (2F1.A)_16. Thus:

(753.625)_10 = (1011110001.101)_2 = (1361.5)_8 = (2F1.A)_16

The wider survey of coded representations, BCD and Gray code among them, sits in Number Systems and Base Conversions: GATE Worked Examples.

Grouping is not a universal shortcut. To convert (2314)_5 to base 7, first find its value:

2×5^3 + 3×5^2 + 1×5 + 4 = 250 + 75 + 5 + 4 = 334

Repeated division of 334 by 7 produces remainders 5, 5, 6. Reading upward gives (655)_7. The reverse check is 6×49 + 5×7 + 5 = 294 + 35 + 5 = 334.

Interpret a bit pattern before applying complements

A fixed-width pattern has no signed meaning until its representation is stated. For eight bits, unsigned values range from 0 to 255, while two's-complement values range from -128 to 127. Sign-magnitude uses the first bit as a sign, one's complement forms a negative by inverting every bit, and two's complement inverts every bit and adds 1.

The pattern 11010000 means 208 when unsigned but -48 in two's complement. Start with +48 = 00110000. Invert it to obtain 11001111, then add 1 to obtain 11010000. Applying the same operation again returns 00110000, confirming magnitude 48.

Two's complement has one zero and an extra negative value, unlike one's complement, which has positive and negative zero.

Perform binary subtraction and diagnose overflow

To calculate 37 - 85 in eight-bit two's complement, encode both magnitudes:

  • 37 = 00100101

  • 85 = 01010101

  • Invert 85: 10101010

  • Add 1: 10101011

  • Add: 00100101 + 10101011 = 11010000

The result decodes to -48. The decimal check is 37 - 85 = -48, which fits the eight-bit signed range.

Carry-out and signed overflow are different tests. Consider 100 + 60:

01100100 + 00111100 = 10100000

Both operands are positive, but the result has sign bit 1, which signals signed overflow. The true sum 160 is outside -128 to 127, so 10100000 is not a valid positive signed answer.

The reverse case exists too. Add -1 and +1 in eight bits: 11111111 + 00000001 = 1 00000000. A carry leaves the most significant position, yet the signed answer 0 is correct, so nothing overflowed. Carry-out reports an unsigned range problem. Signed overflow needs two operands of the same sign and a result whose sign differs from theirs, which is why it can never happen when the signs disagree.

Eight-bit two's complement arithmetic showing 37 minus 85 equals -48 and 100 plus 60 overflowing the signed range.

Avoid the traps that make correct methods fail

Trap

Consequence

Correction

Using a digit illegal in the base

The numeral itself is invalid

Check every digit against 0 to r - 1

Reading integer remainders top-down

The place values are reversed

Read division remainders bottom-up

Grouping from the left edge

Octal or hexadecimal groups become misaligned

Start at the radix point and move outward

Padding a fractional group on the left

The fraction's value changes

Pad fractional groups only on the right

Dropping leading zeros

The fixed width and sign can change

Preserve all stated bits during signed work

Treating carry-out as signed overflow

A signed answer may be judged incorrectly

Check operand and result signs, plus the signed range

Before accepting an answer, ask four questions: Are all digits legal in the stated base? Did I preserve the bit width? Does reconversion reproduce the original value? Does the signed decimal result fit the stated range?

How GATE-style questions combine these ideas

Four constructions recur: a chained conversion followed by arithmetic, of the kind (2314)_5 into base 7 demands; a fixed-width pattern that means nothing until its representation is named, like 11010000; an addition that asks whether signed overflow occurred, like 100 + 60; and a missing digit shared between two equivalent bases. Check the current official GATE syllabus or bulletin for cycle-specific scope rather than relying on an old topic list.

The missing-digit type yields to positional expansion on both sides. Solve (1x1)_8 = (69)_16. The right side is 6×16 + 9 = 105. The left side is 64 + 8x + 1, so 8x = 40 and x = 5. Grouping confirms it: 105 is 1101001 in binary, which pads to 001 101 001 and reads as (151)_8, and to 0110 1001, which reads as (69)_16. Both digits are legal in their own bases, 5 in base 8 and 9 in base 16, so the answer stands.

Now try one: in eight-bit two's complement, is 01110100 + 00110100 valid? The operands are 116 and 52, so the true sum is 168. Their binary sum is 10101000. Two positive inputs produced a negative sign bit, and 168 exceeds 127, so signed overflow occurred. The GATE Test Series is where that recognition gets drilled under a clock.

The short version and the next practice step

Identify the base and legal digits. Expand positional values, convert integer and fractional parts separately, preserve width for signed work, and test overflow against the representation. Reconversion quickly exposes quiet errors.

A practical ladder is five pure conversions, five complement or subtraction questions, and five mixed-interpretation questions from the 200 plus Number System items in our Digital Electronics question bank. For a structured full-subject path, continue with GATE Guidance by Sanchit Sir, or browse the broader GATE catalogue. Once number representation is secure, Boolean algebra and K-map minimization is the natural next symbolic-logic lesson, followed by combinational circuits as the hardware application.