Knowledge / Electronics and Communication Engineering / Number systems and Boolean algebra

Number systems and Boolean algebra

Electronics and Communication Engineering (B.E./B.Tech) · Digital electronics · free study notes for exams, placements and interviews

In short

This topic covers how digital hardware represents numbers (positional radix systems, signed formats, codes) and how it manipulates logic (Boolean algebra, canonical forms and minimisation). Every later block - adders, counters, state machines, ALUs, memories - is built on these two foundations, so examiners treat it as compulsory. It is the highest-yield unit in GATE EC/EE/CS (conversions, 2's complement arithmetic, K-maps, gate-count questions appear almost every year), in ESE/ISRO/DRDO/BEL recruitment papers and in university Digital Electronics papers. In placement tests for Intel, Qualcomm, NXP, Texas Instruments, Samsung SRI-B, Bosch, Cadence and Synopsys, the first-round questions are usually a 2's complement/overflow problem and a Boolean simplification.

Explained

Positional number systems and conversions

Signed numbers and binary arithmetic

Binary codes

Logic gates and Boolean postulates

Boolean theorems, De Morgan and duality

Canonical and standard forms

Minimisation: Karnaugh maps and Quine-McCluskey

Key points

Formulas and examples

N = Σ d_i · ri (d_i = digit, r = radix, i = position index; negative i for fraction digits)
2's complement of n-bit N = 2n − N; 1's complement = (2n − 1) − N; generally r's complement = rn − N
Ranges: unsigned 0 … 2n−1; 2's complement −2n−1 … +2n−1−1; sign-magnitude and 1's complement ±(2n−1−1)
Signed-add overflow V = C_n ⊕ C_(n−1) (C_n = carry out of MSB, C_(n−1) = carry into MSB)
Binary → Gray: g_(n−1) = b_(n−1), g_i = b_(i+1) ⊕ b_i; Gray → binary: b_(n−1) = g_(n−1), b_i = b_(i+1) ⊕ g_i
Minterms of n variables = 2n; distinct Boolean functions of n variables = 22n
De Morgan: (A+B)' = A'B'; (AB)' = A'+B'; Consensus: AB + A'C + BC = AB + A'C
IEEE 754 single: value = (−1)s × 1.f × 2E−127, E = 8-bit biased exponent, f = 23-bit fraction
Hamming SEC: 2k ≥ m + k + 1 (m = data bits, k = parity bits); distance-d code detects d−1, corrects ⌊(d−1)/2⌋ errors
DecBinaryBCD (8421)Excess-3Gray2421
000000000001100000000
100010001010000010001
200100010010100110010
300110011011000100011
401000100011101100100
501010101100001111011
601100110100101011100
701110111101001001101
810001000101111001110
910011001110011011111

Example 1 - mixed-radix conversion of (347.625)₁₀

Example 2 - 8-bit 2's complement subtraction and overflow

Example 3 - K-map minimisation F(A,B,C,D) = Σm(0,1,2,4,5,6,8,9,12,13,14), A = MSB. Equivalently F = ΠM(3,7,10,11,15).

Example 4 - BCD addition and Gray conversion

Example 5 - IEEE 754 single precision for −12.75

FeatureSign-magnitude1's complement2's complement
NegationFlip MSBInvert all bitsInvert + 1
ZerosTwo (+0, −0)TwoOne
8-bit range−127 … +127−127 … +127−128 … +127
Addition hardwareCompare + add/subAdder + end-around carryPlain adder
Use todayFloating-point mantissaLegacy, checksumsAll integer ALUs

Where it is used

Interview questions

Common mistakes

Related topics

Combinational circuits · Sequential circuits: flip-flops, counters and registers · Logic families and semiconductor memories · Finite state machine design · Verilog and HDL basics · Computer organisation: ALU and data representation

Open in the Knowledge reader →Find jobs →