Number systems, representations and codes
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Understand architecture and organization
Architecture describes the interface visible to software, including instructions and data types. Organization describes how buses, circuits and control implement that interface.
Read place values
The units position has weight one. Powers increase to the left and become negative to the right of the radix point. Multiplying digit values by these weights recovers the numeral’s value.
Convert by division and multiplication
Repeated division gives low integer digits first. For a fraction, multiply by the destination radix, emit the integer part, and carry the remainder forward.
Group bits without decimal arithmetic
Octal digits correspond to groups of three bits; hexadecimal digits correspond to groups of four. Start at the radix point and pad only on outside edges.
Recognize repeating fractions
A reduced rational fraction terminates in a destination base only if its denominator divides a power of that base. Repeating remainders produce recurring digits.
Distinguish signed encodings
Sign-magnitude uses a separate sign and ordinary magnitude. One’s complement flips a positive bit pattern. Two’s complement flips and adds one, giving a unique zero.
Choose width before negation
A signed n-bit two’s complement word covers −2^(n−1) through 2^(n−1)−1. Sign extension copies the sign rather than prepending zero to a negative value.
Subtract by complementing
Keep the word width fixed. One’s complement uses end-around carry, while two’s complement discards the carry outside the selected width.
Distinguish overflow from carry
Carry-out is relevant to unsigned addition. Signed overflow means the exact result is beyond the signed range. It can occur with or without an outgoing carry.
Compute and verify four signed operations
The binary numbers listed have a sign in the leftmost position and if negative are in 2’s complement form. Perform the arithmetic operations indicated and verify the answers. (i) 101011 + 111000 (ii) 001110 + 110010 (iii) 111001 − 001010 (iv) 101011 − 100110.
Set the word width and interpretation
The question explicitly uses two’s-complement inputs. Keep the given width and distinguish carry from signed overflow.
101011 + 111000
Add 101011 and 111000. The raw low word is 100011 and carry-out is 1. The final word is 100011.
001110 + 110010
Add 001110 and 110010. The raw low word is 000000 and carry-out is 1. The final word is 000000.
111001 − 001010 using 2’s complement
Add 111001 and 110110. The raw low word is 101111 and carry-out is 1. The final word is 101111.
101011 − 100110 using 2’s complement
Add 101011 and 011010. The raw low word is 000101 and carry-out is 1. The final word is 000101.
Verify the answers
Interpret the inputs in their stated representation and compare ordinary arithmetic to the result word. Check the carry rule independently of the sign bit.
Booklet answer · Compute and verify four signed operations
101011 + 111000
Add 101011 and 111000. The raw low word is 100011 and carry-out is 1. The final word is 100011. Direct signed arithmetic gives -29. It fits and matches the sign-extended result.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 | 0 |
| 2 | 0 | 0 | 0 | 0 | 0 |
| 3 | 1 | 1 | 0 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
001110 + 110010
Add 001110 and 110010. The raw low word is 000000 and carry-out is 1. The final word is 000000. Direct signed arithmetic gives 0. It fits and matches the sign-extended result.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 1 | 0 | 1 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 | 1 |
| 5 | 0 | 1 | 1 | 0 | 1 |
111001 − 001010 using 2’s complement
Add 111001 and 110110. The raw low word is 101111 and carry-out is 1. The final word is 101111. Direct signed arithmetic gives -17. It fits and matches the sign-extended result.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 |
| 2 | 0 | 1 | 0 | 1 | 0 |
| 3 | 1 | 0 | 0 | 1 | 0 |
| 4 | 1 | 1 | 0 | 0 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
101011 − 100110 using 2’s complement
Add 101011 and 011010. The raw low word is 000101 and carry-out is 1. The final word is 000101. Direct signed arithmetic gives 5. It fits and matches the sign-extended result.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 1 | 1 | 0 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 | 1 |
| 5 | 1 | 0 | 1 | 0 | 1 |
Compare decimal, binary, octal and hexadecimal
Differentiate between decimal, binary, octal and hexadecimal.
Read the radix
The radix fixes the number of digit symbols and the place weights.
Relate bases to bit groups
A binary digit is one bit, an octal digit is three and a hex digit is four. Decimal digit grouping instead requires a code if used in binary hardware.
Work one example in four bases
42 in base 10, 101010 in base 2, 52 in base 8, 2A in base 16
Verify the equivalence
Expand each representation as digit times place weight. The sums must represent the same value.
Booklet answer · Compare decimal, binary, octal and hexadecimal
Decimal has radix ten and uses digits 0–9. Binary has radix two and uses digits 0 and 1, matching two-state digital circuits. Octal has radix eight and uses digits 0–7, so each digit corresponds to three bits. Hexadecimal has radix sixteen and uses digits 0–9 and A–F, so each hex digit corresponds to four bits.
For example, 42 (base 10) = 101010 (base 2) = 52 (base 8) = 2A (base 16). Decimal is convenient for people, while octal and hexadecimal provide compact representations of binary words.
Subtract using one’s and two’s complement
(i) Subtract 111001₂ from 101011₂ using the 1’s complement method. (ii) Subtract 101011₂ from 111001₂ using the 2’s complement method.
Set the word width and interpretation
Align the radix points, and left-pad unequal unsigned operands before complementing a subtrahend.
101011 − 111001 using 1’s complement
Add 101011 and 000110. The raw low word is 110001 and carry-out is 0. The final word is 110001.
111001 − 101011 using 2’s complement
Add 111001 and 010101. The raw low word is 001110 and carry-out is 1. The final word is 001110.
Verify the answers
Interpret the inputs in their stated representation and compare ordinary arithmetic to the result word. Check the carry rule independently of the sign bit.
Booklet answer · Subtract using one’s and two’s complement
101011 − 111001 using 1’s complement
Add 101011 and 000110. The raw low word is 110001 and carry-out is 0. The final word is 110001. The difference or sum checked as ordinary magnitudes is -14. With no end carry, complement the negative result word to recover the magnitude.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 1 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 0 |
| 5 | 1 | 0 | 0 | 1 | 0 |
111001 − 101011 using 2’s complement
Add 111001 and 010101. The raw low word is 001110 and carry-out is 1. The final word is 001110. The difference or sum checked as ordinary magnitudes is 14.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 2 | 0 | 1 | 0 | 1 | 0 |
| 3 | 1 | 0 | 0 | 1 | 0 |
| 4 | 1 | 1 | 0 | 0 | 1 |
| 5 | 1 | 0 | 1 | 0 | 1 |
Add two unsigned words and convert the sum
Given the binary numbers 101101 and 110110, perform the following tasks. 1. Add the binary numbers and provide the result. 2. Convert the binary result to its decimal equivalent. 3. Convert the decimal result to Octal and Hexadecimal.
0101101 + 0110110
Add 0101101 and 0110110. The raw low word is 1100011 and carry-out is 0. The final word is 1100011.
Separate the integer and fractional parts
Use the original radix to interpret the input. For power-of-two bases, grouping bits outwards from the radix point gives the same result.
Convert 1100011 to base 10
The source numeral denotes 99 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 99 to base 8
The source numeral denotes 99 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 99 to base 16
The source numeral denotes 99 in decimal. Read integer remainders upwards and fractional digits downwards.
Check termination and BCD
Read divisions in reverse order and multiplications in forward order. An ellipsis denotes truncation, and parentheses identify a complete detected repeat.
Booklet answer · Add two unsigned words and convert the sum
Retain the carry because no fixed-width truncation is requested. Add 0101101 and 0110110. The raw low word is 1100011 and carry-out is 0. The final word is 1100011.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
| 6 | 0 | 0 | 1 | 1 | 0 |
1100011 (base 2) → 99 (base 10)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 10 | Remainder digit |
|---|---|---|
| 99 | 9 | 9 |
| 9 | 0 | 9 |
99 (base 10) → 143 (base 8)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 8 | Remainder digit |
|---|---|---|
| 99 | 12 | 3 |
| 12 | 1 | 4 |
| 1 | 0 | 1 |
99 (base 10) → 63 (base 16)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 16 | Remainder digit |
|---|---|---|
| 99 | 6 | 3 |
| 6 | 0 | 6 |
Convert 105.15 to binary, octal, hex and BCD
Convert the Decimal number 105.15 into Binary, Octal, Hexadecimal and BCD forms.
Separate the integer and fractional parts
Use the original radix to interpret the input. For power-of-two bases, grouping bits outwards from the radix point gives the same result.
Convert 105.15 to base 2
The source numeral denotes 105.15 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 105.15 to base 8
The source numeral denotes 105.15 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 105.15 to base 16
The source numeral denotes 105.15 in decimal. Read integer remainders upwards and fractional digits downwards.
Check termination and BCD
8421 BCD encodes each decimal digit separately: 0001 0000 0101 . 0001 0101. Repeated fractional remainders produce repeating positional digits.
Booklet answer · Convert 105.15 to binary, octal, hex and BCD
105.15 (base 10) → 1101001.00(1001) repeating (base 2)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 2 | Remainder digit |
|---|---|---|
| 105 | 52 | 1 |
| 52 | 26 | 0 |
| 26 | 13 | 0 |
| 13 | 6 | 1 |
| 6 | 3 | 0 |
| 3 | 1 | 1 |
| 1 | 0 | 1 |
| Fraction numerator over 100 | Numerator × 2 | Output digit | Next numerator |
|---|---|---|---|
| 15 | 30 | 0 | 30 |
| 30 | 60 | 0 | 60 |
| 60 | 120 | 1 | 20 |
| 20 | 40 | 0 | 40 |
| 40 | 80 | 0 | 80 |
| 80 | 160 | 1 | 60 |
105.15 (base 10) → 151.1(1463) repeating (base 8)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 8 | Remainder digit |
|---|---|---|
| 105 | 13 | 1 |
| 13 | 1 | 5 |
| 1 | 0 | 1 |
| Fraction numerator over 100 | Numerator × 8 | Output digit | Next numerator |
|---|---|---|---|
| 15 | 120 | 1 | 20 |
| 20 | 160 | 1 | 60 |
| 60 | 480 | 4 | 80 |
| 80 | 640 | 6 | 40 |
| 40 | 320 | 3 | 20 |
105.15 (base 10) → 69.2(6) repeating (base 16)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 16 | Remainder digit |
|---|---|---|
| 105 | 6 | 9 |
| 6 | 0 | 6 |
| Fraction numerator over 100 | Numerator × 16 | Output digit | Next numerator |
|---|---|---|---|
| 15 | 240 | 2 | 40 |
| 40 | 640 | 6 | 40 |
In 8421 BCD, encode the decimal digits separately as 0001 0000 0101 . 0001 0101.
Convert two fractional numerals to octal
Convert the following numbers (i) (163.789)₁₀ to Octal number (4 Marks) (ii) (11001101.0101)₂ to base8 (4 Marks).
Separate the integer and fractional parts
Use the original radix to interpret the input. For power-of-two bases, grouping bits outwards from the radix point gives the same result.
Convert 163.789 to base 8
The source numeral denotes 163.789 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 11001101.0101 to base 8
The source numeral denotes 205.3125 in decimal. Read integer remainders upwards and fractional digits downwards.
Check termination and BCD
Read divisions in reverse order and multiplications in forward order. An ellipsis denotes truncation, and parentheses identify a complete detected repeat.
Booklet answer · Convert two fractional numerals to octal
163.789 (base 10) → 243.623757473310… (base 8)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 8 | Remainder digit |
|---|---|---|
| 163 | 20 | 3 |
| 20 | 2 | 4 |
| 2 | 0 | 2 |
| Fraction numerator over 1000 | Numerator × 8 | Output digit | Next numerator |
|---|---|---|---|
| 789 | 6312 | 6 | 312 |
| 312 | 2496 | 2 | 496 |
| 496 | 3968 | 3 | 968 |
| 968 | 7744 | 7 | 744 |
| 744 | 5952 | 5 | 952 |
| 952 | 7616 | 7 | 616 |
| 616 | 4928 | 4 | 928 |
| 928 | 7424 | 7 | 424 |
| 424 | 3392 | 3 | 392 |
| 392 | 3136 | 3 | 136 |
| 136 | 1088 | 1 | 88 |
| 88 | 704 | 0 | 704 |
11001101.0101 (base 2) → 315.24 (base 8)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 8 | Remainder digit |
|---|---|---|
| 205 | 25 | 5 |
| 25 | 3 | 1 |
| 3 | 0 | 3 |
| Fraction numerator over 16 | Numerator × 8 | Output digit | Next numerator |
|---|---|---|---|
| 5 | 40 | 2 | 8 |
| 8 | 64 | 4 | 0 |
Convert a decimal integer and a hex fraction
Convert the following numbers (i) (4567)₁₀ to base2 (4 Marks) (ii) (4D.56)₁₆ to Binary (4 Marks).
Separate the integer and fractional parts
Use the original radix to interpret the input. For power-of-two bases, grouping bits outwards from the radix point gives the same result.
Convert 4567 to base 2
The source numeral denotes 4567 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 4D.56 to base 2
The source numeral denotes 77.3359375 in decimal. Read integer remainders upwards and fractional digits downwards.
Check termination and BCD
Read divisions in reverse order and multiplications in forward order. An ellipsis denotes truncation, and parentheses identify a complete detected repeat.
Booklet answer · Convert a decimal integer and a hex fraction
4567 (base 10) → 1000111010111 (base 2)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 2 | Remainder digit |
|---|---|---|
| 4567 | 2283 | 1 |
| 2283 | 1141 | 1 |
| 1141 | 570 | 1 |
| 570 | 285 | 0 |
| 285 | 142 | 1 |
| 142 | 71 | 0 |
| 71 | 35 | 1 |
| 35 | 17 | 1 |
| 17 | 8 | 1 |
| 8 | 4 | 0 |
| 4 | 2 | 0 |
| 2 | 1 | 0 |
| 1 | 0 | 1 |
4D.56 (base 16) → 1001101.0101011 (base 2)
The quotient/remainder working for the integer part is shown below. Multiply the fractional remainder repeatedly and record the integer digit each time.
| Dividend | Quotient ÷ 2 | Remainder digit |
|---|---|---|
| 77 | 38 | 1 |
| 38 | 19 | 0 |
| 19 | 9 | 1 |
| 9 | 4 | 1 |
| 4 | 2 | 0 |
| 2 | 1 | 0 |
| 1 | 0 | 1 |
| Fraction numerator over 256 | Numerator × 2 | Output digit | Next numerator |
|---|---|---|---|
| 86 | 172 | 0 | 172 |
| 172 | 344 | 1 | 88 |
| 88 | 176 | 0 | 176 |
| 176 | 352 | 1 | 96 |
| 96 | 192 | 0 | 192 |
| 192 | 384 | 1 | 128 |
| 128 | 256 | 1 | 0 |
Work fixed-point addition and two complement cases
(i) Add the following numbers 232.25+136.75 using binary addition. (6 Marks) (ii) Subtract 16 from 5 using 2’s complement. (5 Marks) (iii) Perform the following using 1’s complement −12+7. (5 Marks).
Align the binary points
The addends become 11101000.01 and 10001000.11. The fractional sum produces a carry into the units column.
Add fixed-point columns, with two fractional bits
The table is empty. Press Next step to fill it one row at a time (11 steps).
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
000101 − 010000 using 2’s complement
Add 000101 and 110000. The raw low word is 110101 and carry-out is 0. The final word is 110101.
10011 + 00111
Add 10011 and 00111. The raw low word is 11010 and carry-out is 0. The final word is 11010.
Check all values in decimal
The binary fixed-point sum is 101110001. The signed subtraction is −11, and −12 plus 7 is −5.
Booklet answer · Work fixed-point addition and two complement cases
Align two binary fraction bits. Add 11101000.01 and 10001000.11 to obtain 101110001. The two fractional digits together generate an integer carry.
Represent 5 and 16 in six bits. Add the two’s complement of 16 to 5 and keep the low six bits, obtaining 110101 for −11.
For −12 + 7 use five-bit one’s complement. The code of −12 is 10011. Add 7 and check any end-around carry. The result is 11010, which is the complement of +5.
BCD, Gray, Excess-3 and parity
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Separate digits from a bit string
BCD encodes each decimal digit using four bits. Excess-3 adds three to each digit before encoding. Neither uses one positional binary integer for the whole decimal numeral.
Carry in BCD
A four-bit word can hold values above nine. Add six to any raw BCD digit sum above nine to discard the six invalid codes and produce a decimal carry.
Generate Gray code and parity
Keep the leading binary bit and XOR each following bit with the previous binary bit for Gray conversion. A parity bit makes the total count of ones even or odd as specified.
BCD addition of 984 and 599 and complement subtraction
(i) Perform BCD Addition for 984+599. (4 marks) (ii) Perform (111100) − (1011) using 1’s and 2’s complement method. (4 marks)
Represent the decimal digits separately
984 is 1001 1000 0100; 599 is 0101 1001 1001. Add from units towards the most significant digit.
Correct any raw digit greater than nine
The table is empty. Press Next step to fill it one row at a time (4 steps).
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
111100 − 1011 using 1’s complement
Add 111100 and 110100. The raw low word is 110000 and carry-out is 1. Add the carry back at the low end. The final word is 110001.
111100 − 1011 using 2’s complement
Add 111100 and 110101. The raw low word is 110001 and carry-out is 1. The final word is 110001.
Check the BCD digits
Every corrected group encodes a decimal digit. Read from the most significant group to obtain 0001 0101 1000 0011 = 1583.
Booklet answer · BCD addition of 984 and 599 and complement subtraction
In the digit sums, add binary 0110 whenever the raw digit total is above nine, and propagate the corrected carry to the next position.
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
| 0 | 4 | 9 | 0 | 01101 | 6 | 0011 | 1 |
| 1 | 8 | 9 | 1 | 10010 | 6 | 1000 | 1 |
| 2 | 9 | 5 | 1 | 01111 | 6 | 0101 | 1 |
| 3 | 0 | 0 | 1 | 00001 | 0 | 0001 | 0 |
The decimal result 1583 has BCD representation 0001 0101 1000 0011.
111100 − 1011 using 1’s complement
Add 111100 and 110100. The raw low word is 110000 and carry-out is 1. Add the carry back at the low end. The final word is 110001. The difference or sum checked as ordinary magnitudes is 49.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
111100 − 1011 using 2’s complement
Add 111100 and 110101. The raw low word is 110001 and carry-out is 1. The final word is 110001. The difference or sum checked as ordinary magnitudes is 49.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
BCD addition of 175 and 326 and complement subtraction
(i) Perform BCD Addition for 175 and 326. (4 marks) (ii) Perform (111100) − (001011) using 1’s and 2’s complement method. (4 marks)
Represent the decimal digits separately
175 is 0001 0111 0101; 326 is 0011 0010 0110. Add from units towards the most significant digit.
Correct any raw digit greater than nine
The table is empty. Press Next step to fill it one row at a time (3 steps).
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
111100 − 001011 using 1’s complement
Add 111100 and 110100. The raw low word is 110000 and carry-out is 1. Add the carry back at the low end. The final word is 110001.
111100 − 001011 using 2’s complement
Add 111100 and 110101. The raw low word is 110001 and carry-out is 1. The final word is 110001.
Check the BCD digits
Every corrected group encodes a decimal digit. Read from the most significant group to obtain 0101 0000 0001 = 501.
Booklet answer · BCD addition of 175 and 326 and complement subtraction
In the digit sums, add binary 0110 whenever the raw digit total is above nine, and propagate the corrected carry to the next position.
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
| 0 | 5 | 6 | 0 | 01011 | 6 | 0001 | 1 |
| 1 | 7 | 2 | 1 | 01010 | 6 | 0000 | 1 |
| 2 | 1 | 3 | 1 | 00101 | 0 | 0101 | 0 |
The decimal result 501 has BCD representation 0101 0000 0001.
111100 − 001011 using 1’s complement
Add 111100 and 110100. The raw low word is 110000 and carry-out is 1. Add the carry back at the low end. The final word is 110001. The difference or sum checked as ordinary magnitudes is 49.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
111100 − 001011 using 2’s complement
Add 111100 and 110101. The raw low word is 110001 and carry-out is 1. The final word is 110001. The difference or sum checked as ordinary magnitudes is 49.
| Bit | A | Operand | Carry in | Result bit | Carry out |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
BCD addition of 375 and 648
Perform the operation (375 + 648)₁₀ using BCD addition step by step. (i) Write the final result in BCD form and also in Binary form. (ii) Convert the result into octal, Hexadecimal.
Represent the decimal digits separately
375 is 0011 0111 0101; 648 is 0110 0100 1000. Add from units towards the most significant digit.
Correct any raw digit greater than nine
The table is empty. Press Next step to fill it one row at a time (4 steps).
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
Convert 1023 to base 2
The source numeral denotes 1023 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 1023 to base 8
The source numeral denotes 1023 in decimal. Read integer remainders upwards and fractional digits downwards.
Convert 1023 to base 16
The source numeral denotes 1023 in decimal. Read integer remainders upwards and fractional digits downwards.
Check the BCD digits
Every corrected group encodes a decimal digit. Read from the most significant group to obtain 0001 0000 0010 0011 = 1023.
Booklet answer · BCD addition of 375 and 648
In the digit sums, add binary 0110 whenever the raw digit total is above nine, and propagate the corrected carry to the next position.
| Place from right | A digit | B digit | Carry in | Raw binary | Correction | BCD digit | Carry out |
|---|---|---|---|---|---|---|---|
| 0 | 5 | 8 | 0 | 01101 | 6 | 0011 | 1 |
| 1 | 7 | 4 | 1 | 01100 | 6 | 0010 | 1 |
| 2 | 3 | 6 | 1 | 01010 | 6 | 0000 | 1 |
| 3 | 0 | 0 | 1 | 00001 | 0 | 0001 | 0 |
The decimal result 1023 has BCD representation 0001 0000 0010 0011.
1023 (base 10) → 1111111111 (base 2)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 2 | Remainder digit |
|---|---|---|
| 1023 | 511 | 1 |
| 511 | 255 | 1 |
| 255 | 127 | 1 |
| 127 | 63 | 1 |
| 63 | 31 | 1 |
| 31 | 15 | 1 |
| 15 | 7 | 1 |
| 7 | 3 | 1 |
| 3 | 1 | 1 |
| 1 | 0 | 1 |
1023 (base 10) → 1777 (base 8)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 8 | Remainder digit |
|---|---|---|
| 1023 | 127 | 7 |
| 127 | 15 | 7 |
| 15 | 1 | 7 |
| 1 | 0 | 1 |
1023 (base 10) → 3FF (base 16)
The quotient/remainder working for the integer part is shown below.
| Dividend | Quotient ÷ 16 | Remainder digit |
|---|---|---|
| 1023 | 63 | F |
| 63 | 3 | F |
| 3 | 0 | 3 |
Boolean logic and gates
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Draw gate shapes and bubbles
An inversion bubble changes the logical polarity at that pin. For NAND and NOR, inversion is on the output.
Read the common gates
| A | B | AND | OR | NOT | NAND | NOR | XOR | XNOR | BUFFER |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
Push a complement across a gate
De Morgan’s law changes an AND into OR or an OR into AND and complements each argument. This allows implementation in a single gate family.
Map a product of sums
NOR each parenthesized sum, then NOR the results. The two levels restore the intended AND of sums.
Use adjacency to simplify
A Karnaugh map uses Gray order so adjacent cells differ by one bit, including across edges. Group ones in powers of two and retain the variables constant within each group.
Draw logic symbols and derive their truth tables
Draw the graphic symbol, algebraic function and truth table for the following logic gates. (i) AND (ii) OR (iii) NAND (iv) EX-OR.
Identify the operators
Use the flat-backed symbol for AND, the curved symbol for OR, and a triangle for NOT or a buffer. XOR has a second curve at the input.
Associate the expressions and symbols
| Gate | Symbol | Expression |
|---|---|---|
| AND | A·B | |
| OR | A+B | |
| NAND | (A·B)′ | |
| XOR | A⊕B |
Evaluate all input patterns
The table is empty. Press Next step to fill it one row at a time (4 steps).
| A | B | AND | OR | NAND | XOR |
|---|---|---|---|---|---|
Check the complements and input count
A bubble complements the result. A repeated column for NOT or BUFFER is intentional because that output depends on A alone.
Booklet answer · Draw logic symbols and derive their truth tables
The symbol, Boolean function and output for each possible input are as follows. Unary gates use A only. The output bubble denotes inversion.
| Gate | Symbol | Expression |
|---|---|---|
| AND | A·B | |
| OR | A+B | |
| NAND | (A·B)′ | |
| XOR | A⊕B |
| A | B | AND | OR | NAND | XOR |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
AND requires all inputs high, OR requires at least one high, and XOR responds to unequal inputs. NAND, NOR and XNOR invert their corresponding gate’s output.
Implement a NOR-only expression and binary-to-Gray logic
(i) Implement F=(A′+B)(C+D′)E′ using only NOR Gates. (4 marks) (ii) Convert Binary “1010” into Gray code and also draw the logic diagram to implement the conversion. (4 marks)
Complement the literals with tied inputs
Tie each NOR input to A or D to obtain A′ or D′ respectively.
Construct the two-level network
A′ = NOR(A,A) D′ = NOR(D,D) N1 = NOR(A′,B) N2 = NOR(C,D′) F = NOR(N1,N2,E)
Implement Gray conversion with XOR
G3 ← B3 G2 ← B3 XOR B2 G1 ← B2 XOR B1 G0 ← B1 XOR B0
Verify the selected input and output
The product of sums is the complement of the OR of its complemented factors. For the Gray converter, input 1010 gives 1111.
Booklet answer · Implement a NOR-only expression and binary-to-Gray logic
Use tied-input NORs to generate A′ and D′. Next form N1=(A′+B)′ and N2=(C+D′)′. The final three-input NOR gives (N1+N2+E)′, equal to (A′+B)(C+D′)E′ by De Morgan. A three-input OR stage for E can be synthesized using two-input NORs and an inverter if necessary.
The Gray converter copies B3 and XORs successive input bits. Thus 1010 gives 1111.
A′ = NOR(A,A) D′ = NOR(D,D) N1 = NOR(A′,B) N2 = NOR(C,D′) F = NOR(N1,N2,E)
G3 ← B3 G2 ← B3 XOR B2 G1 ← B2 XOR B1 G0 ← B1 XOR B0
Build NOT, AND and OR from NAND and NOR
Describe briefly about Universal Gates? Show how to implement the basic gates using Universal Gates.
Illustrate briefly about Universal Gates? Show how to implement the basic gates using Universal Gates.
Define universality
NOT, AND and OR suffice to build any Boolean expression. Showing all three from a single gate type proves that type is universal.
Use NAND alone
NOT A = NAND(A,A) AND = NAND(NAND(A,B), NAND(A,B)) OR = NAND(NAND(A,A), NAND(B,B))
Use NOR alone
NOT A = NOR(A,A) OR = NOR(NOR(A,B), NOR(A,B)) AND = NOR(NOR(A,A), NOR(B,B))
Check using De Morgan
For the NAND OR circuit the final NAND complements A′B′, giving A+B. For the NOR AND circuit the final NOR complements A′+B′, giving AB.
Booklet answer · Build NOT, AND and OR from NAND and NOR
NAND is universal. Tie its inputs to invert A. NAND A with B and then invert that output to recover AND. Invert each input with tied NANDs and NAND the inverted inputs to obtain OR by De Morgan’s law.
NOR is also universal. Tie its inputs to invert A. NOR A with B and invert the output to form OR. Invert the separate inputs and NOR those two inverted signals to obtain AND. Since each gate alone realizes NOT, AND and OR, either can realize every Boolean function.
NOT A = NAND(A,A) AND = NAND(NAND(A,B), NAND(A,B)) OR = NAND(NAND(A,A), NAND(B,B))
NOT A = NOR(A,A) OR = NOR(NOR(A,B), NOR(A,B)) AND = NOR(NOR(A,A), NOR(B,B))
Draw logic symbols and derive their truth tables
Describe all the logic gates with symbols and truth table.
Identify the operators
Use the flat-backed symbol for AND, the curved symbol for OR, and a triangle for NOT or a buffer. XOR has a second curve at the input.
Associate the expressions and symbols
| Gate | Symbol | Expression |
|---|---|---|
| AND | A·B | |
| OR | A+B | |
| NOT | A′ | |
| NAND | (A·B)′ | |
| NOR | (A+B)′ | |
| XOR | A⊕B | |
| XNOR | (A⊕B)′ | |
| BUFFER | A |
Evaluate all input patterns
The table is empty. Press Next step to fill it one row at a time (4 steps).
| A | B | AND | OR | NOT | NAND | NOR | XOR | XNOR | BUFFER |
|---|---|---|---|---|---|---|---|---|---|
Check the complements and input count
A bubble complements the result. A repeated column for NOT or BUFFER is intentional because that output depends on A alone.
Booklet answer · Draw logic symbols and derive their truth tables
The symbol, Boolean function and output for each possible input are as follows. Unary gates use A only. The output bubble denotes inversion.
| Gate | Symbol | Expression |
|---|---|---|
| AND | A·B | |
| OR | A+B | |
| NOT | A′ | |
| NAND | (A·B)′ | |
| NOR | (A+B)′ | |
| XOR | A⊕B | |
| XNOR | (A⊕B)′ | |
| BUFFER | A |
| A | B | AND | OR | NOT | NAND | NOR | XOR | XNOR | BUFFER |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
AND requires all inputs high, OR requires at least one high, and XOR responds to unequal inputs. NAND, NOR and XNOR invert their corresponding gate’s output.
Part A quick check
| Paper | Question and options | Answer and reason |
|---|---|---|
| Dec2022 Q6 | In one’s complement system the negative values are obtained by complementing each bit of the corresponding _____ number. A. Positive B. Neutral C. Negative D. Negative and positive | A · Flipping the positive magnitude word gives its negative code. |
| Dec2022 Q7 | In addition of singed numbers, add n-bits and ignore the _____ signal from MSB position. A. Carry out B. Carry in C. Positive D. Negative | A · Fixed-width two’s complement discards carry beyond the word. |
| Dec2022 Q8 | The _____ representation of numbers occupies a large amount of memory A. 1’s complement B. 2’s complement C. Signed numbers D. Signed magnitude | Ambiguous · All four fixed-width encodings occupy the same number of bits at a given width. |
| Dec2022 Q9 | The method which has two representations for ‘0’ is called _____. A. Hashing B. Binary pair coding C. Bit pair coding D. Signed magnitude | D · Positive zero and negative zero have distinct signed-magnitude encodings. |
| May2023 Q1 | The binary equivalent of the decimal number 26.2 is _____. A. 10010.1101 B. 11010.0011 C. 11110.1110 D. 01110.0011 | B approximate · 26 is 11010₂ and 0.2 repeatedly generates the digits 0011. |
| May2023 Q2 | Find the hexadecimal value for the decimal number 264 A. 128 B. 108 C. 2A1 D. 761 | B · 264 = 1×256 + 0×16 + 8. |
| May2023 Q3 | The 2’s complement of the binary number 101101 is _____. A. 011010 B. 100010 C. 001010 D. 010011 | D · Invert to 010010 and add one. |
| May2023 Q4 | Signed 2’s complement of −16 in 8-bit representation is _____. A. 10111011 B. 10001100 C. 01110000 D. 00110101 | None · The eight-bit word is 11110000. |
| Nov2023 Q1 | Decimal 43 in Hexadecimal and BCD number system is respectively A. B2, 0100 0011 B. 2B, 0100 0011 C. B2, 0011 0100 D. 2B, 0100 0011 | B or D · 43 is 2B in hex and its two decimal digits encode as 0100 and 0011. |
| Nov2023 Q2 | The 2’s complement representation of −17 is A. 01110 B. 11110 C. 01111 D. 10001 | None · −17 needs six signed bits and encodes as 101111. |
| Nov2023 Q3 | The Excess-3 code of 23 is A. 0101 0011 B. 0010 0000 C. 0010 0110 D. 0101 0110 | D · Add three to each decimal digit before encoding it. |
| Nov2023 Q4 | The equivalent gate is [A and B feed a NOR; its output feeds both inputs of a second NOR; a final inverter produces Y]. A. NOR B. AND C. NAND D. OR | A · The tied NOR and final inverter are two inversions, leaving A NOR B. |
| May2024 Q1 | The representation of hexadecimal number (6DE)H is decimal is _____. A. 6×16²+13×16¹+14×16⁰ B. 6×16²+12×16¹+13×16⁰ C. 6×16²+11×16¹+14×16⁰ D. 6×16²+14×16¹+15×16⁰ | A · D and E have digit values 13 and 14. |
| May2024 Q2 | 1’s complement of 1011101 is _____. A. 0101110 B. 1001101 C. 0100010 D. 1100101 | C · Invert each of the seven input bits. |
| May2024 Q3 | Which of the following gate will give a 0 when both of its inputs are 1? A. AND B. OR C. NAND D. EXOR | C or D · NAND negates 1 AND 1 and XOR of equal inputs is also zero. |
| May2024 Q4 | _____ are universal gates. A. NOT B. NAND & NOR C. AND D. NOT, AND & OR | B · Either NAND alone or NOR alone can synthesize all Boolean functions. |
| May2024 Q10 | According to De-Morgan’s theorem: NAND = _____. A. Bubbled AND B. Bubbled NOR C. Bubbled XOR D. Bubbled OR | D · NAND equals OR with both inputs complemented. |
| Nov2024 Q1 | Reflected binary code is also known as A. BCD Code B. Binary Code C. ASCII Code D. Grey Code | D · The reflected construction produces Gray code. |
| Nov2024 Q2 | Which of the following is the correct hexadecimal representation for the decimal number 255? A. FF B. F0 C. FE D. F1 | A · 255 = 15×16 + 15. |
| Nov2024 Q3 | What is the 2’s complement of the binary number 00001101? A. 11110010 B. 11110011 C. 11110001 D. 11101101 | B · Invert and add one within eight bits. |
| Nov2024 Q4 | What is the gray code equivalent of the binary number 11011? A. 10110 B. 10001 C. 11101 D. 10010 | A · Keep the MSB and XOR successive binary bits. |
| Jun2025 Q1 | How many bits are used to represent each decimal digit in BCD? A. 2 bits B. 3 bits C. 4 bits D. 8 bits | C · The 8421 code uses one four-bit pattern per digit. |
| Jun2025 Q2 | Convert the binary number 0110011 into its 2’s complement. A. 1001000 B. 1001101 C. 1001100 D. 0110011 | B · Invert the bits to 1001100 and add one. |
| Jun2025 Q3 | High level design is exhibited in A. Computer Architecture B. Computer Organization C. Computer BIOS D. Computer Architecture and Organization | A · Architecture specifies the programmer-visible machine and interfaces. |
| Jun2025 Q4 | Generate the gray code for the binary number 1010. A. 1111 B. 1001 C. 1100 D. 1000 | A · Keep the leading bit and XOR each adjacent pair. |
| Jul2025 Q1 | Identify The Binary Representation of Decimal Number 42 A. 101010 B. 101111 C. 111100 D. 1110000 | A · 42 decomposes into 32, 8 and 2. |
| Jul2025 Q2 | Find the grey code for binary value 1011110 A. 1100111 B. 1100110 C. 1110001 D. 1110000 | C · XOR the unsigned binary pattern with that pattern shifted right once. |
| Jul2025 Q3 | The 2’s complement of the binary number 101101 is A. 011010 B. 100010 C. 100010 D. 010011 | D · Complement six bits, then add one. |
| Jul2025 Q4 | Parity code is used for the purpose of A. Code Conversion B. Correcting Errors C. Detecting Errors D. Decoding | C · A single parity bit detects an odd number of flipped bits. |
| Nov2025 Q1 | The octal equivalent of the decimal number (417)₁₀ is _____. A. (641)₈ B. (619)₈ C. (640)₈ D. (598)₈ | A · 417 = 6×64 + 4×8 + 1. |
| Nov2025 Q2 | On subtracting (010110)₂ from (1011001)₂ using 2’s complement, we get _____. A. 0111001 B. 0111011 C. 0110110 D. 1000011 | D · At seven bits the unsigned subtraction gives 89 − 22 = 67. |
| Nov2025 Q3 | The given hexadecimal number (1E.53)₁₆ is equivalent to _____. A. (35.684)₈ B. (36.246)₈ C. (34.340)₈ D. (35.599)₈ | B · Convert each hexadecimal digit to four bits, then regroup into triplets around the point. |
| Nov2025 Q4 | If the number of bits in the sum exceeds the number of bits in each added numbers, it results in _____. A. Successor B. Overflow C. Underflow D. Predecessor | B · A result that cannot fit the given width overflows under the stated representation. |
| May2026 Q1 | The representation of octal number (532.2)H in decimal is A. (346.25)₁₀ B. (532.864)₁₀ C. (340.67)₁₀ D. (531.668)₁₀ | A · The stem says octal, so use weights 64, 8, 1 and 1/8. |
| May2026 Q2 | How many bits are used to represent each decimal digit in BCD? A. 2 bits B. 3 bits C. 4 bits D. 8 bits | C · 8421 BCD uses four bits per decimal digit. |
| May2026 Q3 | Generate the gray code for the binary number 1010. A. 1111 B. 1001 C. 1100 D. 1000 | A · Keep the leading bit and XOR adjacent pairs. |
| May2026 Q4 | _____ are universal gates. A. NOT B. NAND & NOR C. AND D. NOT, AND & OR | B · Each of NAND and NOR can synthesize all basic gates. |
| May2026 Q9 | According to De-Morgan’s theorem: NAND = A. Bubbled XOR B. Bubbled NOR C. Bubbled AND D. Bubbled OR | D · NAND equals OR with both inputs complemented. |
| Dec2018-IT0205 Q6 | Find the 1’s and 2’s complement of the number (10110)₂. | Short answer · 01001 and 01010. Invert all five bits, then add one for the second answer. |
| Nov2019 Q5 | Perform binary addition of 110H 0010 is _____. A. 1110 B. 1111 C. 0111 D. 11101 | A intended · Reading the blurred first operand as 1100₂ gives 1100₂ + 0010₂ = 1110₂. |
| Nov2019 Q7 | _____ is a straight forward method of representing positive and negative number. A. Radix B. Complement C. Sign magnitude D. Encode | C · Sign magnitude stores a sign bit and an ordinary magnitude. |
| Nov2019 Q8 | The sign magnitude representation of −9 is _____. A. 00001001 B. 11111001 C. 10001001 D. 11001 | C or D · Both are sign-magnitude forms, with eight and five bits respectively. |
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Unit 1 checklist
Before you move on, can you do each of these without looking?
0 of 4 topics complete
Not sure about one? Go back to it in the topic list and press Next step through the worked question once more. Ticks are saved in this browser. Final checklist for the subject →
Unit complete. Up next: Unit 2, Computer structure, instructions and addressing.
All units