Pancyprian TS Dig. Electronics II study materials
Pancyprian TS Dig. Electronics II study resources

Pancyprian TS Dig. Electronics II: Number Systems, Binary Codes and Boolean Algebra

Pancyprian TS Dig. Electronics II · Work through your exam, one topic at a time.

All guide sections

Number Systems, Binary Codes and Boolean Algebra

This domain is the arithmetic and algebraic foundation of Digital Electronics II. The exam checks that you convert fluently between decimal, binary, octal and hexadecimal, represent negative values correctly, select the right binary code for a given job, and reduce a Boolean expression before anyone draws a gate.

Positional notation

  • Each bit carries weight 2^n starting from the LSB; one hex digit equals 4 bits, one octal digit equals 3 bits.
  • Decimal to binary: repeated division by 2, remainders read bottom-up. Binary to hex: group 4 bits starting at the LSB and pad the leftmost group with leading zeros.
  • With n bits the unsigned range is 0 to 2^n - 1, so n bits give 2^n distinct codes.

Signed numbers and codes

  • Two's complement is the standard signed format: negate by inverting every bit and adding 1. The range is -2^(n-1) to +2^(n-1) - 1.
  • Subtraction is addition of the two's complement; the final carry out is discarded.
  • 8421 BCD encodes one decimal digit per 4 bits; codes 1010 to 1111 are invalid, and a BCD sum above 9 needs a +0110 correction.
  • Gray code changes only one bit per step, which is why it is used in encoders and in K-map ordering; binary to Gray is G = B XOR (B shifted right by one).

Boolean algebra

  • Workhorse identities: A + AB = A, A + A'B = A + B, (A·B)' = A' + B', (A + B)' = A'·B'.
  • Canonical SOP is the OR of all minterms where the function is 1; POS is the AND of the maxterms where it is 0.
  • Karnaugh maps: group 1, 2, 4, 8 or 16 adjacent cells, wrap around edges, and absorb don't-care cells to enlarge a group.

Worked example

Interpret the byte 11010110. Grouping from the right gives 1101 = D and 0110 = 6, so the hex value is D6. Unsigned decimal: 128 + 64 + 16 + 4 + 2 = 214. As a signed 8-bit number the MSB is 1, so invert to 00101001, add 1 to get 00101010 = 42, and the value is -42; the check is 214 - 256 = -42.

Traps that cost marks

  • Forgetting the final +1 after inverting in two's complement.
  • Grouping hex digits from the left end instead of from the LSB.
  • Writing BCD digits as A to F, or omitting the +0110 correction.
  • Applying De Morgan by changing the operator but leaving the bars unchanged.
  • Ignoring don't-care states, so a larger and more expensive circuit is produced.