Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

1

CHAPTER 1
NUMBER SYSTEMS
INTRODUCTION
The base of a number system is the number of digits it uses. The decimal number
system has base of 10 because it uses the digits 0 to 9. The binary number system has a
base of 2 because it uses the digits 0 and 1. The octal number system has a base of 8. It
uses the digits 0 to 7. Hexadecimal number system has a base of 16. It uses the digits 0 to 9
and A to F.
DECIMAL NUMBER SYSTEM
The decimal system is composed of 10 numerals or symbols. These 10 symbols are
0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. Using these symbols, we can express any quantity. The
decimal system is called the base-10 system because it has 10 digits. The decimal system is
a positional-value system, wherein each digit has its own value or weight expressed as a
power of 10. This is illustrated in Fig. 1.1. Here, places to the left of the decimal point are
positive powers of 10 and places to the right are negative powers of 10.
Decimal weight: 104 103 102 101 100 . 10-1 10-2 10-3
Decimal value: 10000 100 100 10 1 . 0.1 0.01 0.001
0
↑ ↑ ↑
MSD Decimal LSD
point
Fig. 1.1: Decimal position values (weights) as powers of 10
BINARY NUMBER SYSTEM
In the binary system there are only two symbols or digit values, 0 and 1. This base-2
system can be used to represent any quantity that can be represented in decimal or other
number systems. The binary system is a positional-value system, wherein each binary digit
has its own value or weight expressed as a power of 2. This is illustrated in Fig. 1.2. Here,
places to the left of the binary point are positive powers of 2 and places to the right are
negative powers of 2.
Binary weight: 26 25 24 23 22 21 20 . 2-1 2-2 2-3
Decimal value: 64 3 16 8 4 2 1 . 0.5 0.25 0.125
2
↑ ↑ ↑
MSB Binary LSB
point
Fig. 1.2: Binary position values (weights) as powers of 2
OCTAL NUMBER SYSTEM
The octal number system has a base of eight, meaning that it has eight possible
digits: 0, 1, 2, 3, 4, 5, 6 and 7. Thus, each digit of an octal number can have any value from
0 to 7. The octal system is a positional-value system, wherein each digit has its own value or
weight expressed as a power of 8.The digit positions in an octal number have weights as
shown in Fig. 1.3. Here, places to the left of the octal point are positive powers of 8 and
places to the right are negative powers of 8.
Octal weight: 84 83 82 81 80 . 8-1 8-2 8-3
Decimal value: 4096 512 64 8 1 . 0.125 0.016 0.002
↑ ↑ ↑
MSD Octa LSD
l
point
Fig. 1.3: Octal position values (weights) as powers of 8
HEXADECIMAL NUMBER SYSTEM
The hexadecimal number system has a base of 16, meaning that it has sixteen
possible digits: 0 through 9 plus the letters A, B, C, D, E and F. Thus, each digit of an octal
number can have any value from 0 to F. The hexadecimal system is a positional-value
2

system, wherein each digit has its own value or weight expressed as a power of 16. The digit
positions in a hexadecimal number have weights as shown in Fig. 1.4. Here, places to the
left of the hexadecimal point are positive powers of 16 and places to the right are negative
powers of 16.
Hexadecimal weight: 163 162 161 160 . 16-1 16-2
Decimal value: 4096 256 16 1 . 0.062 0.004
5
↑ ↑ ↑
MSD Hexadecimal LSD
point
Fig. 1.4: Hexadecimal position values (weights) as powers of 16
Hexadecimal numbers are used extensively in microprocessor based systems and
computers. They are shorter than binary numbers. It is easy to write and remember
hexadecimal numbers. It is easy to convert hexadecimal numbers to binary.
Table. 1.1 shows the relationship among hexadecimal, decimal and binary. Each
hexadecimal digit represents a group of four binary digits. Hex digits A through F are
equivalent to the decimal values 10 through 15.
Hexadecimal Decimal Binary
Digit
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
Table. 1.1 Relationship among hexadecimal, decimal and binary
SUBSCRIPTS
Subscripts are used to represent the base of the number system as shown in Table.
1.2.
Number Subscript Example
system equations
Binary 2 12 + 12 = 102
Octal 8 78 + 18 = 108
Decimal 10 910 + 110 = 1010
Hexadecimal 16 F16 + 116 = 1016
Table. 1.2 Subscripts
BINARY TO DECIMAL CONVERSION
When converting from binary to decimal, each digit must be multiplied by its weight
and the resulting products should be added.
Example 1. Convert 11011012 to decimal.
Solution:
Binary number: 1 1 0 1 1 0 1
Binary weight: 26 25 24 23 22 21 20
Decimal value: 64 3 16 8 4 2 1
2
1101101 2 =64×1+32×1+16×0+8×1+4×1+2×0+1×1
=64×1+32×1+16×0+ 8×1+ 4×1+ 2×0+1×1
=64 +32+0+8+ 4+ 0+1=109
3

=109
11011012 = 10910

Example 2. Determine the decimal value of the fractional binary number 0.1011.
Solution:
Binary number: 0 . 1 0 1 1
Binary weight: 20 . 2-1 2-2 2-3 2-4
Decimal value: 1 . 0.5 0.25 0.125 0.0625
0 .1011 2 =(1×0 ).(0 . 5×1+ 0. 25×0+0 . 125×1+0 . 0625×1 )
=(0).(0 .5+0+0 .125+ 0. 0625 )=0 . 6875
0.10112 = 0.672510
Example 3. Convert 1001.1012 to decimal.
Solution:
Binary number: 1 0 0 1 . 1 0 1
Binary weight: 23 22 21 20 . 2-1 2-2 2-3
Decimal value: 8 4 2 1 . 0.5 0.25 0.125
1001. 101 2 =( 8×1+4×0+2×0+ 1×1) .(0 .5×1+0 .25×0+0. 125×1 )
=(8+0+0+1). (0. 5+0+ 0. 125 )=9 . 625
1001.1012 = 9.62510
OCTAL TO DECIMAL CONVERSION
When converting from octal to decimal, each digit must be multiplied by its weight
and the resulting products should be added.
Example 1. Convert 23758 to decimal.
Solution:
Octal number: 2 3 7 5
Octal weight: 83 82 81 80
Decimal value: 512 64 8 1
23748 =512×2+ 64×3+8×7+1×5
=1024+ 192+ 56+5
=127710
23758 = 127710
Example 2. Convert 0.3258 to decimal.
Solution:
Octal number: 0 . 3 2 5
Octal weight: 80 . 8-1
8-2
8-3
Decimal value: 1 . 0.125 0.016 0.002
0 .325 8=(1×0 ).(0. 125×3+0 .016×2+0 . 002×5 )
=(0).(0 .375+0. 032+0 . 01)
=0 . 417 10
0.3258 = 0.41710
Example 3. Convert 24.68 to decimal.
Solution:
Octal number: 2 4 . 6
Octal weight: 81 80 . 8-1
Decimal value: 8 1 . 0.125
24 . 68 =( 8×2+1×4 ). (0. 125×6)
=(16+4 ).(0 .75 )
=20 . 7510
24.68 = 20.7510
4

HEXADECIMAL TO DECIMAL CONVERSION


When converting from hexadecimal to decimal, each digit must be multiplied by its
weight and the resulting products should be added.
Example 1. Convert A8516 to decimal.
Solution:
Hexadecimal number: A 8 5
Hexadecimal weight: 162 161 160
Decimal value: 256 16 1
A85 16=256× A+16×8+1×5
=256×10+16×8+1×5
=2560+128+5
=(2693)10
A8516 = 269310
Example 2. Convert F8E6.3916 to decimal.
Solution:
Hexadecimal number: F 8 E 6 . 3 9
Hexadecimal weight: 16 3
16 16 16 .
2 1 0
16 -1
16-2
Decimal value: 4096 256 16 1 . 0.0625 0.004
F8E6 .3916 =(4096×F+ 256×8+16×E +1×6 ). (0. 0625×3+0 . 004×9)
=(4096×15+256×8+16×14+1×6).(0 . 06×3+ 0. 004×9 )
=(61440+2048+224+ 6).(0 .18+ 0. 04 )
=63718 . 2210
F8E6.3916 = 63718.2210
DECIMAL TO BINARY CONVERSION
Integer Part Conversion
Fig. 1.5: Flowchart for decimal-to-binary conversion of integers
Conversion from decimal to binary is performed by dividing the decimal number
successively by 2 and writing down the remainders. Whenever a quotient of less than 2 is
reached, the conversion is complete. The remainders taken in the reverse order is the binary
number. Fig. 1.5 shows the flowchart for decimal-to-binary conversion of integers. The same
process can be used to convert a decimal integer to any other number system.
Fraction Part Conversion
Fraction is multiplied by 2 and a carry is recorded in the integer position. The process
of multiplication is continued till the desired accuracy is reached. Reading the carry
downward gives the binary fraction.
Example 1. Convert 4510 to binary.
Solution:
Remainder
2 4 → 1 (LSB)
5
2 2 → 0
2
2 1 → 1
1
2 5 → 1
2 2 → 0
2 1 → 1 (MSB)
0
4510 = 1011012
5

Example 2. Convert 0.8510 to binary.


Solution:
0 .85×2=1.7=0.7 with a carry of 1 (MSB)
0.7×2=1.4=0.4 with a carry of 1
0.4×2=0.8=0 .8 with a carry of 0
0. 8×2=1.6=0.6 with a carry of 1 ( LSB)
0.8510 = 0.11012
Example 3. Convert 25.3510 to binary.
Solution:
Integer part conversion
Remainder
2 2 → 1 (LSB)
5
2 1 → 0
2
2 6 → 0
2 3 → 1
2 1 → 1 (MSB)
0
2510 = 110012
Fraction part conversion
0 .35×2=0.7=0 .7 with a carry of 0 ( MSB)
0.7×2=1.4=0.4 with a carry of 1
0.4×2=0.8=0 .8 with a carry of 0
0. 8×2=1.6=0.6 with a carry of 1 ( LSB)
0.3510 = 0.0101
25.3510 = 11001.01012
DECIMAL TO OCTAL CONVERSION
Integer Part Conversion
When converting from decimal to octal, divide the given decimal number by 8 and
write down the remainders after each division. Whenever a quotient of less than 8 is
reached, the conversion is complete. The remainders taken in the reverse order is the octal
number.
Fraction Part Conversion
Fraction is multiplied by 8 and a carry is recorded in the integer position. The process
of multiplication is continued till the desired accuracy is reached. Reading the carry
downward gives the octal fraction.
Example 1. Convert 35910 to octal.
Solution:
Remainder
8 359 → 7 (LSD)
8 44 → 4
8 5 → 5 (MSD)
0
35910 = 5478
6

Example 2. Convert 0.2310 into an octal fraction.


Solution:
0 .23×8=1.84=0 .84 with a carry of 1 (MSD )
0 .84×8=6. 72=0 .72 with a carry of 6
0 .72×8=5.76=0 .76 with a carry of 5
0 .76×8=6 . 08=0 . 08 with a carry of 6 (LSD )
0.2310 = 0.16568

Example 3. Convert 894.4510 into octal.


Solution:
Integer part conversion
Remainder
8 894 → 6 (LSD)
8 111 → 7
8 13 → 5
8 1 → 1 (MSD)
0
89410 = 15768
Fraction part conversion
0. 45×8=3 .6=0. 6 with a carry of 3 (MSD )
0.6×8=4 .8=0.8 with a carry of 4
0.8×8=6.4=0 .4 with a carry of 6
0 . 4×8=3. 2=0. 2 with a carry of 3 (LSD )
0.4510 = 0.34638
894.4510 = 1576.34638
DECIMAL TO HEXADECIMAL CONVERSION
Integer Part Conversion
Conversion from decimal to hexadecimal is performed by dividing the decimal
number successively by 16 and writing down the remainders. Whenever a quotient of less
than 16 is reached, the conversion is complete. The remainders taken in the reverse order is
the hexadecimal number.
Fraction Part Conversion
Fraction is multiplied by 16 and a carry is recorded in the integer position. The
process of multiplication is continued till the desired accuracy is reached. Reading the carry
downward gives the hexadecimal fraction.
Example 1. Convert 42310 to hexadecimal.
Solution:
Remainder
16 423 → 7 (LSD)
16 26 → A
16 1 → 1 (MSD)
0
42310 = 1A716
Example 2. Convert 0.9410 into a hexadecimal fraction.
Solution:
0 . 94×16=15 .04=0 .04 with a carry of F (MSD)
0. 04×16=0. 64=0.64 with a carry of 0
0.64×16=10 .24=0.24 with a carry of A
0 .24×16=3 . 84=0 .84 with a carry of 3 (LSD )
0.9410 = 0.F0A316
Example 3. Convert 894.4510 into hexadecimal.
7

Solution:
Integer part conversion
Remainder
16 894 → E (LSD)
16 55 → 7
16 3 → 3 (MSD)
0
89410 = 37E16

Fraction part conversion


0 .45×16=7 . 2=0 .2 with a carry of 7 ( MSD)
0.2×16=3.2=0.2 with a carry of 3
0.2×16=3.2=0.2 with a carry of 3
0 .2×16=3. 2=0.2 with a carry of 3(LSD)
0.4510 = 0.733316
894.4510 = 37E.733316
OCTAL TO BINARY CONVERSION
When converting from octal to binary, change each octal digit to its 3-bit binary
equivalent as shown in Table. 1.3.

Octal Digit 3-bit


Binary
Equivalent
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
Table. 1.3: Octal to binary conversion
Example. 1. Convert 52748 to binary.
Solution:
Octal number: 5 2 7 4
↓ ↓ ↓ ↓
Binary equivalent: 101 010 111 100
52748 = 1010101111002
Example 2. Represent 0.548 by its binary equivalent fraction.
Solution:
Octal number: 0 . 5 4
↓ ↓ ↓ ↓
Binary 000 . 101 100
equivalent:
0.548 = 000.1011002
Example 3. Represent 73.428 by its binary equivalent.
Solution:
Octal number: 7 3 . 4 2
↓ ↓ ↓ ↓ ↓
Binary equivalent: 111 011 . 100 010
73.428 = 111011.1000102
HEXADECIMAL TO BINARY CONVERSION
When converting from hexadecimal binary, each hexadecimal digit is converted into
its 4-bit equivalent binary code as shown in Table. 1.4.
8

Hexadecimal 4-bit
Digit Binary
Equivalent
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Table. 1.4: Hexadecimal to binary conversion
Example. 1. Convert A2F416 to binary.
Solution:
Hexadecimal A 2 F 4
number:
↓ ↓ ↓ ↓
Binary equivalent: 1010 0010 1111 0100
A2F416 = 10100010111101002
Example 2. Represent 0.A416 by its binary equivalent fraction.
Solution:
Hexadecimal number: 0 . A 4
↓ ↓ ↓ ↓
Binary equivalent: 0000 . 1010 0100
0.A416 = 0000.101001002
Example 3. Represent B3.A216 by its binary equivalent.
Solution:
Hexadecimal B 3 . A 2
number:
↓ ↓ ↓ ↓ ↓
Binary equivalent: 1011 001 . 1010 0010
1
B3.A28 = 10110011.101000102
BINARY TO OCTAL CONVERSION
When converting from binary to octal, group the bits in threes starting at the binary
point. Then convert each group of three bits to its octal equivalent. 0s can be added if
necessary. For example, 11.012 = 011.0102.
Example 1. Represent 10111001102 by its octal equivalent.
Solution: Add 0s so that the given binary number can be arranged in groups of 3 bits.
9

10111001102 = 0010111001102
Binary number: 001 011 100 110
↓ ↓ ↓ ↓
Octal 1 3 4 6
equivalent:
10111001102 = 13468

Example 2. Represent 0.10112 by its octal equivalent fraction.


Solution: Add 0s so that the given binary fraction can be arranged in groups of 3 bits.
0.10112 = 000.1011002
Binary number: 000 . 101 100
↓ ↓ ↓ ↓
Octal equivalent: 0 . 5 4
0.10112 = 0.548
Example 3. Represent 11.100012 by its octal equivalent.
Solution: Add 0s so that the given binary number can be arranged in groups of 3 bits.
11.100012 = 011.1000102
Binary number: 011 . 100 010
↓ ↓ ↓ ↓
Octal equivalent: 3 . 4 2
11.100012 = 3.428
BINARY TO HEXADECIMAL CONVERSION
When converting from binary to hexadecimal, group the bits in fours starting at the
binary point. Then convert each group of four bits to its hexadecimal equivalent. 0s can be
added if necessary. For example, 11.012 = 0011.01002.
Example 1. Convert 1111110001011010002 to hexadecimal.
Solution: Add 0s so that the given binary number can be arranged in groups of 4 bits.
1111110001011010002 = 001111110001011010002
Binary number: 0011 111 0001 0110 1000
1
↓ ↓ ↓ ↓ ↓
Hexadecimal equivalent: 3 F 1 6 8
1111110001011010002 = 3F16816
Example 2. Convert 0.1112 to hexadecimal equivalent fraction.
Solution: Add 0s so that the given binary number can be arranged in groups of 4 bits.
0.1112 = 0000.11102
Binary number: 0000 . 1110
↓ ↓ ↓
Hexadecimal 0 . E
equivalent:
0.1112 = 0.E16
Example 3. Convert 011111.1012 to hexadecimal.
Solution: Add 0s so that the given binary number can be arranged in groups of 4 bits.
011111.1012 = 00011111.10102
Binary number: 000 1111 . 1010
1
↓ ↓ ↓ ↓
Hexadecimal equivalent: 1 F . A
011111.1012 = 1F.A16
BINARY ARITHMETIC
ADDITION
There are four basic rules for adding binary digits:
0+0= 0
0+1= 1
10

1+0= 1
1 + 1 = 102
Three of the addition rules result in a single bit. Addition of two 1s yields a binary two
(102). This condition creates a sum of 0 and a carry of 1 over to the next higher column.
When there is a carry, three bits are being added. The rules for this are as follows:
1+ 0 + 0 = 01 1 with a carry of 0
1+ 0 + 1 = 10 0 with a carry of 1
1+ 1 + 0 = 102 0 with a carry of 1
1+ 1 + 1 = 112 1 with a carry of 1

Example 1. Add the following pair of binary numbers: 1001 + 1111


Solution:
1001 (9)
+1111 (15)
11000 (24)

Example 2. Add the following pair of binary numbers: 11.011 +10.110


Solution:
11.011 (3.375)
+10.11 (2.750)
0
110.001 (6.125)
Note: Decimal equivalents are in parenthesis.
SUBTRACTION
There are four basic rules for subtracting binary digits:
0–0=0
1–1=0
1–0=1
102 -1 = 1
A borrow is required when subtracting a 1 from a 0. In this case, when a 1 is
borrowed from the next higher column, a 102 is created in the column being subtracted and
the last of the four basic rules listed above must be applied.
Example 1. Perform the following binary subtraction: 11 - 10
Solution:
11 (3)
-10 (2)
01 (1)
Example 2. Perform the following binary subtraction: 101 - 011
Solution:
101 (5)
-011 (3)
010 (2)
MULTIPLICATION
The following are four basic rules for multiplying binary digits:
0x0=0
0x1=0
1x0=0
1x1=1
Multiplication is performed in binary in the same manner as with decimal numbers. It
involves the following steps:
1. Form the partial products
2. Shifting each successive partial product left one place
3. Add all the partial products
11

Example 1. Perform the following binary multiplication: 111×101


Solution:
111 (7)
¿ 101 (5)
111
000
111
100011 (35)
Example 2. Perform the following binary multiplication: 1011×1001
Solution:
1011 (11)
¿ 1001 (9)
1011
0000
0000
1011
1100011 (99)

DIVISION
Division in binary follows the same procedure as division in decimal.
Example 1. Perform the following binary division: 110÷11
Solution:

¿¿¿¿¿
Example 2. Perform the following binary division: 1111. 0÷110
Solution:

UNSIGNED BINARY NUMBERS


¿ ¿
In some applications, all data is either positive or negative. In such cases, the + and
– signs can be ignored and only the magnitude of numbers can be represented. For
example, the smallest 8-bit number is 0000 0000 and the largest is 1111 1111. Therefore,
the total range of 8-bit number is
0000 0000 to 1111 1111
This is equivalent to a decimal 0 to 255. Data of this type is called unsigned binary because
all the bits in a binary number are used to represent the magnitude. Some examples of
unsigned numbers are as follows:
15010 = 1001 0110
8510 = 0101 0101
SIGN-MAGNITUDE NUMBERS
When data has positive and negative values, the magnitude is converted into its
binary equivalent and a sign is prefixed. 0 is used for the + sign and 1 for the – sign.
Numbers in this form are called sign-magnitude numbers. The most significant bit (MSB)
12

always represents the sign and the remaining bits stand for the magnitude. Some examples
of sign-magnitude numbers are as follows:
+710 = 0000 0111
-1610 = 1001 0000
With an 8-bit sign-magnitude number, the largest magnitude is 127. The largest
magnitude is approximately half that of unsigned binary numbers. The negative numbers are
1000 0000 to 1111 1111 (-1 to -127). The positive numbers are 0000 0001 to 0111 1111 (+1
to +127).
Merits
 Simplicity.
 It is easy to find the magnitude by deleting the sign bit.
Demerits
 Complicated arithmetic circuits are required handle sign-magnitude numbers.
Applications
 Suitable in situations where there is no need to add or subtract the data.
 Analog-to-digital conversions
1’S COMPLEMENT OF A BINARY NUMBER
The 1’s complement of a binary number is found by simply changing all 1s to 0s and
all 0s to 1s.
Examples: Find the 1’s complement of the binary numbers:
Binary 1’s
number Complement
10101 01010
10111 01000
111100 000011
11011011 00100100
1’S COMPLEMENT SUBTRACTION
1’s complement method allows us to subtract binary numbers using only addition.
Merits
 Subtraction can be accomplished with an adder.
 1’s complement of a number is easily obtained by inverting each bit in the number.
Applications
 Arithmetic logic circuits
Subtracting a Smaller Number from a Larger Number
The format for subtraction is
Minuend - Subtrahend = Difference
To subtract a smaller number from a larger number, the 1’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 1’s complement of the subtrahend.
3. Add the 1’s complement to the minuend.
4. Remove end-around carry and add it to the result to get the final answer.
Example 1. Subtract 100112 from 110012 using 1’s complement method.
Solution: It is required to perform 110012 - 100112.
Minuend = 11001
Subtrahend = 10011
11001 Minuend
+ 01100 1’s complement of the subtrahend
1 00101
+1 Add end-around carry
00110 Final answer
Example 2. Subtract 6810 from 12510 using 1’s complement method.
Solution: It is required to perform 12510 - 6810.
Minuend = 12510 = 1111101
Subtrahend = 6810 = 1000100
13

1111101 Minuend
+ 0111011 1’s complement of the subtrahend
1 0111000
+1 Add end-around carry
0111001 Final answer (= 5710)
Subtracting a Larger Number from a Smaller Number
To subtract a larger number from a smaller number, the 1’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 1’s complement of the subtrahend.
3. Add the 1’s complement to the minuend. There is no carry. The result has an
opposite sign and is in the 1’s complement of the answer.
4. To get the answer in the true form, take the 1’s complement and change the sign.
Example 1. Subtract 11012 from 10012 using 1’s complement method.
Solution: It is required to perform 10012 - 11012.
Minuend = 1001
Subtrahend = 1101

1001 Minuend
+ 0010 1’s complement of the subtrahend
No carry; 1’s complement of the answer
1011
and opposite in sign
- 0100 Final answer (-410)
Example 2. Subtract 10810 from 1410 using 1’s complement method.
Solution: It is required to perform 1410 - 10810.
Minuend = 1410 = 0001110
Subtrahend = 10810 = 1101100
0001110 Minuend
+ 0010011 1’s complement of the subtrahend
0100001 No carry; 1’s complement of the answer
and opposite in sign
- 1011110 Final answer (-9410)
2’S COMPLEMENT OF A BINARY NUMBER
There are two methods of finding the 2’s complement of a binary number.
Method 1
The 2’s complement of a binary number is found by adding 1 to the 1’s complement.
Example 1. Find the 2’s complement of the binary number 110.
Solution:
110 Binary Number
001 1’s complement of 110
+1 Add 1
010 2’s complement of 110
Example 2. Find the 2’s complement of the binary number 10101.
Solution:
1010 Binary Number
1
0101 1’s complement of 10101
0
+1 Add 1
0101 2’s complement of 10101
1
Method 2
14

An alternative method of obtaining the 2’s complement s as follows:


1. Start at the right and write the bits as they are up to and including the first 1.
2. Take the 1’s complement of the remaining bits.
Example : Find the 2’s complement of the following binary numbers:
Binary 2’s
number Complement
10101 01011
10111 01001
111100 000100
11011011 00100101
Note
1. To represent signed numbers in binary, a sign bit is attached as the MSB. Positive
numbers have a sign bit of 0 and negative numbers have a sign bit of 1.
2. Positive numbers are represented by a sign bit of 0 followed by the magnitude in its
true binary form.
3. Negative numbers are represented by a sign bit of 1 followed by the magnitude in 2’s
complements form.
4. Taking 2’s complement is equivalent to negation or changing the sign of the number.
2’S COMPLEMENT SUBTRACTION
2’s complement method allows us to subtract binary numbers using only addition.
Merits
 In 2’s complement method, end-around carry operation does not have to be
performed.

Applications
 Microcomputer architecture and programming
Subtracting a Smaller Number from a Larger Number
To subtract a smaller number from a larger number, the 2’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 2’s complement of the subtrahend.
3. Add the 2’s complement to the minuend.
4. Discard the carry.
Example 1. Subtract 10112 from 11002 using 2’s complement method.
Solution: It is required to perform 11002 - 10112.
Minuend = 1100
Subtrahend = 1011
1100 Minuend
+ 0101 2’s complement of the subtrahend
1 0001 Discard carry
0001 Final answer
Example 2. Subtract 6810 from 12510 using 2’s complement method.
Solution: It is required to perform 12510 - 6810.
Minuend = 12510 = 1111101
Subtrahend = 6810 = 1000100
1111101 Minuend
+ 0111100 2’s complement of the subtrahend
1 0111001 Discard carry
0111001 Final answer (= 5710)
Subtracting a Larger Number from a Smaller Number
To subtract a larger number from a smaller number, the 2’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 2’s complement of the subtrahend.
15

3. Add the 2’s complement to the minuend. There is no carry. The result has an
opposite sign and is in the 2’s complement of the answer.
4. To get the answer in the true form, take the 2’s complement and change the sign.
Example 1. Subtract 111002 from 100112 using 2’s complement method.
Solution: It is required to perform 100112 - 111002.
Minuend = 10011
Subtrahend = 11100
10011 Minuend
+ 00100 2’s complement of subtrahend
10111 No carry; 2’s complement of the answer
and opposite in sign
- 01001 Final answer
Example 2. Subtract 10810 from 1410 using 2’s complement method.
Solution: It is required to perform 1410 - 10810.
Minuend = 1410 = 0001110
Subtrahend = 10810 = 1101100
0001110 Minuend
+ 0010100 2’s complement of the subtrahend
0100010 No carry; 2’s complement of the answer
and opposite in sign.
- 1011110 Final answer (-9410)
9’S COMPLEMENT OF A DECIMAL NUMBER
The 9’s complement of a decimal number is found by subtracting each digit in the
number from 9 as shown in Table. 1.5.

Decima 9’s complement


l (= 9 - decimal
digit digit)
0 9
1 8
2 7
3 6
4 5
5 4
6 3
7 2
8 1
9 0
Table. 1.5: 9’s complement of decimal digits
Example 1. Find the 9’s complement of 349710.
Solution: To get the 9’s complement of a decimal number, each digit in the number is
subtracted from 9.
9999
- 3497
6502 9’s complement of 3497
9’S COMPLEMENT SUBTRACTION
9’s complement method allows us to subtract decimal numbers using only addition.
Subtracting a Smaller Number from a Larger Number
To subtract a smaller number from a larger number, the 9’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 9’s complement of the subtrahend.
3. Add the 9’s complement to the minuend.
4. Remove end-around carry and add it to the result to get the final answer.
Example 1. Subtract 2110 from 5410 using 9’s complement method.
Solution: It is required to perform 5410 - 2110.
Minuend = 5410
16

Subtrahend = 2110

54 Minuend
+ 9’s complement of subtrahend
78
1 32
+ 1 Add end-around carry
33 Final answer
Example 2. Subtract 12210 from 12610 using 9’s complement method.
Solution: It is required to perform 12610 - 12210.
Minuend = 12610
Subtrahend = 12210
126 Minuend
+ 9’s complement of subtrahend
877
1 003
+ 1 Add end-around carry
04 Final answer
Subtracting a Larger Number from a Smaller Number
To subtract a larger number from a smaller number, the 9’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 9’s complement of the subtrahend.
3. Add the 9’s complement to the minuend. There is no carry. The result has an
opposite sign and is in the 9’s complement of the answer.
4. To get the answer in the true form, take the 9’s complement and change the sign.

Example 1. Subtract 9910 from 2810 using 9’s complement method.


Solution: It is required to perform 2810 - 9910
Minuend = 2810
Subtrahend = 9910
28 Minuend
+ 00 9’s complement of subtrahend
28 No carry; 9’s complement of the answer
and opposite in sign
- 71 Final answer
Example 2. Subtract 10810 from 10410 using 9’s complement method.
Solution: It is required to perform 10410 - 10810.
Minuend = 10410
Subtrahend = 10810
104 Minuend
+ 891 9’s complement of subtrahend
995 No carry; 9’s complement of the answer
and opposite in sign.
- 004 Final answer
10’S COMPLEMENT OF A DECIMAL NUMBER
The 10’s complement of a decimal number is equal to the 9’s complement plus 1.
Example 1. Find the 10’s complement of 349710.
Solution: To get the 10’s complement of a decimal number, first find the 9’s complement
and then add 1.
9999
-
3497
17

6502 9’s complement of 3497


+ 1 Add 1
6503 10’s complement of 3497
10’S COMPLEMENT SUBTRACTION
10’s complement method allows us to subtract decimal numbers using only addition.
Subtracting a Smaller Number from a Larger Number
To subtract a smaller number from a larger number, the 10’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 10’s complement of the subtrahend.
3. Add the 10’s complement to the minuend.
4. Discard the carry.
Example 1. Subtract 2110 from 5410 using 10’s complement method.
Solution: It is required to perform 5410 - 2110.
Minuend = 5410
Subtrahend = 2110
54 Minuend
+ 79 10’s complement of subtrahend
1 33 Discard carry
33 Final answer
Example 2. Subtract 12210 from 12610 using 10’s complement method.
Solution: It is required to perform 12610 - 12210.
Minuend = 12610
Subtrahend = 12210
126 Minuend
+ 10’s complement of subtrahend
878
1 004 Discard carry
004 Final answer

Subtracting a Larger Number from a Smaller Number


To subtract a larger number from a smaller number, the 10’s complement method is
as follows:
1. Write down the minuend.
2. Determine the 10’s complement of the subtrahend.
3. Add the 10’s complement to the minuend. There is no carry. The result has a
negative sign and is in the 10’s complement of the answer.
4. To get the answer in the true form, take the 10’s complement and change the sign.
Example 1. Subtract 9910 from 2810 using 10’s complement method.
Solution: It is required to perform 2810 - 9910
Minuend = 2810
Subtrahend = 9910
28 Minuend
+ 01 10’s complement of subtrahend
29 No carry; 10’s complement of the answer
and opposite in sign.
- 71 Final answer
Example 2. Subtract 10810 from 10410 using 10’s complement method.
Solution: It is required to perform 10410 - 10810.
Minuend = 10410
Subtrahend = 10810
104 Minuend
+ 892 10’s complement of subtrahend
996 No carry; 10’s complement of the answer
18

and opposite in sign.


- 004 Final answer
HEXADECIMAL ADDITION
When adding two hexadecimal digits, the following rules are used:
1. In any given column, convert the two hexadecimal digits to their decimal value.
2. If the sum of these two digits is 15 10 or less, write down the corresponding
hexadecimal digit.
3. If the sum of these two digits is greater than 15 10, write down the amount of the sum
that exceeds 1610 and carry a 1 to the next column.
Example 1. Add the following hexadecimal numbers: 2B16 + 8416
Solution:
2B16
+ 8416
AF16
Right column: B16 + 416 = 1110 + 410 = 1510 = F16
Left column: 216 + 816 = 210 + 810 = 1010 = A16
Example 2. Add the following hexadecimal numbers: DF16 + AC16
Solution:
DF16
+ AC16
18B16
Right column: F16 + C16 = 1510 + 1210 = 2710 = B16 with a carry of 1
Left column: D16 + A16 +116 = 1310 + 1010 + 110 = 2410 = 816 with a carry of 1
HEXADECIMAL SUBTRACTION USING 2’S COMPLEMENT METHOD
Since a hexadecimal number can be used to represent a binary number, it can also
be used to represent the 2’s complement of a binary number. For example, the hexadecimal
representation of 110010012 is C916. The 2’s complement of this binary number is
001101112, which is written in hexadecimal as 3716. The 2’s complement allows us to
subtract by adding binary numbers. We can use this method for hexadecimal subtraction.

Example 1. Perform the hex subtraction using 2’s complement method: 8416 - 2A16.
Solution:
Minuend = 8416
Subtrahend = 2A16 = 001010102
2’s complement of subtrahend = 110101102 = D616
8416 Minuend
+ D616 2’s complement of subtrahend
1 5A16 Discard carry
5A16 Final answer
Example 2. Perform the hex subtraction using 2’s complement method: 8416 - FA16.
Solution:
Minuend = 8416
Subtrahend = FA16 = 111110102
2’s complement of subtrahend = 000001102 = 0616
2’s complement of 8A16 = 2’s complement of 100010102 = 011101102 = 7616
8416 Minuend
+ 0616 2’s complement of subtrahend
8A16 No carry; 2’s complement of the answer
and opposite in sign.
- 7616 Final answer
STUDY OF CODES
The process of representing numbers, letters or words by a special group of symbols
is called encoding and the group of symbols is called a code.
19

STRAIGHT BINARY CODING


Any decimal number can be represented by an equivalent binary number. The group
of 0s and 1s in the binary number is a code representing the decimal number. Representing
decimal number by its equivalent binary number is called straight binary coding.
BINARY-CODED-DECIMAL (BCD) CODE
If each digit of a decimal number is represented by its binary equivalent, the result is
a code called binary-coded-decimal (BCD). Four bits are required to code each decimal digit.
Each decimal digit is changed to straight binary equivalent. Only the four-bit binary numbers
from 0000 through 1001 are used. The BCD code does not use the numbers 1010, 1011,
1100, 1101, 1110 and 1111. Table. 1.6 shows the BCD code in relation with decimal, binary,
octal and hexadecimal system.

Decimal Binary Octal Hexadecimal BCD


0 0000 0 0 0000
1 0001 1 1 0001
2 0010 2 2 0010
3 0011 3 3 0011
4 0100 4 4 0100
5 0101 5 5 0101
6 0110 6 6 0110
7 0111 7 7 0111
8 1000 10 8 1000
9 1001 11 9 1001
10 1010 12 A 0001 0000
11 1011 13 B 0001 0001
12 1100 14 C 0001 0010
13 1101 15 D 0001 0011
14 1110 16 E 0001 0100
15 1111 17 F 0001 0101
Table. 1.6: BCD code
Merits
 It is relatively easy to convert to and from decimal.
Demerits
 BCD requires more bits than straight binary to represent decimal numbers of more
than one digit. Therefore, it is somewhat inefficient.
THE 8421 CODE
The 8421 code is a type of BCD code and is composed of four bits representing the
decimal digits 0 through 9. The designation 8421 indicates the binary weights of the four bits
(23, 22, 21, 20).
DECIMAL TO BCD CONVERSION
To express any decimal number in BCD, replace each decimal digit by the
appropriate four-bit code.
Example 1. Convert decimal number 875 to its BCD code representation.
Solution:
Decimal: 8 7 5
↓ ↓ ↓
BCD: 1000 0111 0101
875 (Decimal) = 100001110101 (BCD)
Example 2. Convert decimal number 34.8 to its BCD code representation.
Solution:
Decimal: 3 4 . 8
↓ ↓ ↓ ↓
BCD:
001 0100 . 1000
1
34.8(Decimal) = 00110100. 1000 (BCD)
BCD TO DECIMAL CONVERSION
20

To determine a decimal number from a BCD number, start at the decimal point and
break the code into groups of four bits. Then write the decimal digit represented by each
four-bit group.
Example 1. Convert BCD number 100101100100 to its decimal equivalent.
Solution:
BCD: 0001 0110 0100
↓ ↓ ↓
Decimal: 9 6 4
100101100100 (BCD) = 964 (Decimal)

Example 2. Convert BCD number 000101100100.1000 to its decimal equivalent.


Solution:
BCD: 100 0110 0100 . 1000
1
↓ ↓ ↓ ↓ ↓
Decimal: 1 6 4 . 8
000101100100.1000 (BCD) = 164.8 (Decimal)
BCD ADDITION
The steps involved in BCD addition are listed below:
1. Add the two numbers using the rules for binary addition.
2. If a four-bit sum is equal to or less than 9, it is a valid BCD number.
3. If a four-bit sum is greater than 9 or if a carry out of the group is generated, it is an
invalid result. Add 6 (01102) to the four-bit sum in order to skip the six invalid states. If
a carry results when 6 is added, simply add the carry to the next four-bit group.
Example 1. Perform the following BCD addition: 100001110010 + 000100010011.
Solution:
BCD Decimal
1000 0111 0010 872
+ 0001 0001 0011 + 113
1001 1000 0101 Valid BCD number 985

Example 2. Perform the following BCD addition: 00010111 + 00010100.


Solution:
BCD Decimal
0001 0111 17
+ 0001 0100 + 14
0010 1011 Left group is valid. 31
Right group is invalid
+ 0110 (>9).
Add 6 to invalid group.
0011 0001 Valid BCD number
Example 3. Perform the following BCD addition: 01100111 + 01010011.
Solution:
BCD Decimal
0110 0111 67
+ 0101 0011 + 53
1011 1010 Both groups are invalid (>9). 120
+ 0110 0110 Add 6 to both the groups.
0001 0010 Valid BCD number
0000
21

EXCESS-3 CODE
Decimal BCD Excess-3
0 000 0011
0
1 000 0100
1
2 001 0101
0
3 001 0110
1
4 010 0111
0
5 010 1000
1
6 011 1001
0
7 011 1010
1
8 100 1011
0
9 100 1100
1
Table. 1.7: Excess-3 code
The excess-3 code is a 4-bit code used with binary-coded decimal (BCD) numbers.
To convert any decimal number into its excess-3 form, 3 is added to each decimal digit and
the sum is converted into a BCD number. Since no definite weights can be assigned to the
four digit positions, Excess-3 is an unweighted code. The minimum distance of Excess-3
code is 1. It is the smallest number of bits by which any two successive code words differ.
Table. 1.7 shows the excess-3 code for each decimal digit.
Ten of possible 16-code combinations are used in the Excess-3 code. The six invalid
combinations are 0000, 0001, 0010, 1101, 1110 and 1111. The key feature of the Excess-3
code is that it is self-complementing. Excess-3 code is a self-complementing code. That is,
Excess-3 code for 9’s complement of N is the 1’s complement of the Excess-3 code for N. It
is used in some arithmetic circuits.
Example:
Let N be 0001.
Excess-3 code for N is 0100.
1’s complement of excess-3 code for N = 1’s complement of 0100 = 1011.
9’s complement of N = 9’s complement of 0001 = 9 - 1 = 8 = 1000.
Excess-3 code for 9’s complement of N = Excess-3 code for1000 = 1011.
DECIMAL TO EXCESS-3 CODE CONVERSION
To convert decimal to Excess-3 code, add 3 to each digit in the decimal number and
then convert each resulting sum to its equivalent binary code.

Example 1. Convert the decimal number 159 to Excess-3 code.


Solution:
Decimal 1 5 9
number:
+3 +3 +3
4 8 12
↓ ↓ ↓
Excess-3 code: 0100 100 1100
0
22

Excess-3 code for 15910 is 0100 1000 1100


GRAY CODE
Decimal Binary Gray
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Table 1.8: Gray code
The Gray code is an unweighted code, which means that there are no specific
weights assigned to the bit positions. The important property of the Gray code is that it
exhibits only a single-bit change from one code number to the next. This property is useful in
many applications such as shaft position encoders. Gray code is not an arithmetic code.
Table 1.8 shows the Gray code along with the corresponding decimal and binary numbers.
Like binary, Gray code can have any number of bits.
Gray code cannot be used in arithmetic circuits. It is used in instrumentation and data
acquisition systems where linear and angular displacement is measured. It is commonly
associated shaft encoders, I/O devices, A/D converters and other peripheral devices.
BINARY TO GRAY CONVERSION
Let the binary number be B3B2B1B0 with B3 being the MSB and B0 the LSB. Let the
corresponding Gray code be G3G2G1G0 with G3 being the MSB and G0 the LSB. G3 in the
Gray code is the same as the corresponding digit B3 in the binary number. That is,
G 3 =B 3
The other bits in the Gray code are given by the following logical expressions:
G2 =B 3 ⊕B2
G 1=B2 ⊕ B1
G0 =B 1 ⊕ B 0
For details regarding exclusive OR operation ( ⊕ ), refer page.
Example 1. Convert binary 1011 to Gray code.
Solution:
B3 B2 B1 B0 = 1011
G3 =B 3=1
G 2 =B 3 ⊕ B2 =1
G 1=B2 ⊕ B1 =1
G 0 =B 1 ⊕ B 0=0
1011 (Binary) = 1110 (Gray)

GRAY TO BINARY CONVERSION


Let Gray code be G3G2G1G0 with G3 being the MSB and G0 the LSB. Let the
corresponding the binary number be B3B2B1B0 with B3 being the MSB and B0 the LSB. B3 in
the binary number is the same as the corresponding digit G3 in the Gray code. That is,
B 3 =G 3
The other bits in the binary number are given by the following logical expressions:
B 2=B3 ⊕ G2
23

B 1=B2 ⊕G1
B 0 =B 1 ⊕ G 0
Example 1. Convert Gray code 0101 to binary.
Solution:
G3 G2 G1 G0 = 0101
B 3 =G3=0
B 2=B3 ⊕ G 2 =1
B 1=B2 ⊕ G 1 =1
B 0 =B 1 ⊕ G 0=0
0101 (Gray) = 0110(Binary)
ALPHANUMERIC CODES
In addition to numerical data, a computer must be able to handle non-numerical
information such as letters of the alphabet, punctuation marks and other special characters
using codes. These codes are called alphanumeric codes. A complete alphanumeric code
would include the 26 lowercase letters, 26 uppercase letters, 10 numeric digits, 7
punctuation marks and other characters such as +, /, £, @, % and so on. An alphanumeric
code represents all the various characters and functions that are found on a computer
keyboard.
AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE (ASCII) CODE
The most widely used alphanumeric code is the ASCII code. It is an unweighted 7-
bit code. ASCII code allows manufacturers to standardize computer hardware such as
keyboards, printers and video displays. The features of ASCII are as follows:
1. Each code word consists of 7 bits. Hence, we have a total of 2 7 (= 128) possible
combinations to represent letters in the alphabet, punctuation marks and numbers.
2. There is a definite order in which symbols are assigned to each code word. The code
is divided into two groups. The first three bits in the code are used to identify whether
the remaining four bits represent letters, numerals or punctuation marks. For
example, 100 and 101 represent upper-case letters. Upper-case letter A is
represented by 100 0001 (4116), B is represented by 100 0001 (4216) and so on. 110
and 111 represent lower-case letters. Lower-case letter a is represented by 110 0001
(6116), b is represented by 110 0001 (6216) and so on.
3. Redundant bits can be added for error-detection and correction.
EXTENDED BINARY CODED DECIMAL INTERCHANGE CODE (EBCDIC)
EBCDIC is an 8-bit alphanumeric code in which decimal digits are represented by the
8421 BCD code preceded by 1111. Both lowercase and uppercase letters are represented in
addition to numerous other symbols and commands. The features of ASCII are as follows:
Each code word consists of 8 bits. Hence, we have a total of 2 8 (= 256) possible
combinations to represent letters in the alphabet, punctuation marks and numbers.
The code is divided into two groups. Each group contains four bits.

IMPORTANT POINTS
5. The base of a number system equals the number of digits it uses.
6. Weight refers to the decimal value of each digit position of a number.
7. Bit is an abbreviated form of binary digit.
8. When converting from binary (or octal or hex) to decimal, use the method of taking
the weighted sum of each digit position.
24

9. When converting from decimal to binary (or octal or hex), use the method of
repeatedly dividing by 2 (or 8 or 16) and collecting the remainders.
10. When converting from binary to octal (or hex), arrange the bits in groups of three (or
four) and convert each group into the correct octal (or hex) digit.
11. When converting from octal (or hex) to binary, convert each digit into its three-bit (or
four-bit) equivalent.
12. When converting from octal to hex (or vice versa), first convert to binary, then convert
binary into the desired number system.
13. The 1’s complement of a binary number is found by simply changing all 1s to 0s and
all 0s to 1s.
14. The 2’s complement of a binary number = 1’s complement + 1.
15. To represent signed numbers in binary, a sign bit is attached as the MSB. Positive
numbers have a sign bit of 0 and negative numbers have a sign bit of 1.
16. Positive numbers are represented by a sign bit of 0 followed by the magnitude in its
true binary form.
17. Negative numbers are represented by a sign bit of 1 followed by the magnitude in 2’s
complements form.
18. Taking 2’s complement is equivalent to negation or changing the sign of the number.
19. The two numbers in an addition are the addend and the augend.
20. The two numbers in a subtraction are the subtrahend and the minuend.
21. If a four-bit sum is greater than 9 in BCD addition, 6 (0110 2) is added to the four-bit
sum as a corrective step.
22. The 7-bit ASCII code is an alphanumeric code widely used for transferring data into
and out of a computer.
23. Excess-3 code is a self-complementing code. That is, Excess-3 code for 9’s
complement of N is the 1’s complement of the Excess-3 code for N.
24. The minimum distance of Excess-3 code is 1. It is the smallest number of bits by
which any two successive code words differ.
25. The important property of the Gray code is that it exhibits only a single-bit change
from one code number to the next.
REVIEW QUESTIONS
Objective Type
1) In the hex counting sequence, the number after E9F is .
2) is an abbreviated form of binary digit.
3) code is an alphanumeric code widely used in computer system.
4) 25510 = 2.
5) 11111112 = 10.
6) 51110 = 8.
7) 2358 = 10.
8) 7A916 = 10.
9) 160010 = 16.
10) 8610 = (BCD).
11) 1001 0100 (BCD) = 10.
12) 468 = 16.
13) B316 = 8.
14) 01110100 (BCD) = 2.
15) 1110102 = (BCD).
16) Conversion from decimal to requires repeated division by 8.
17) Conversion from decimal to hex requires repeated division by .
18) In code, only one bit changes from one step to the next.
19) code is a self-complementing code.
20) The hexadecimal system uses symbols.
21) The 2’s complement number 0111 represents in binary.
22) The 2’s complement number 0111 represents in decimal.
23) The 2’s complement number 1111 represents in decimal.
25

24) In 2’s complement representation, the MSB is the bit.


25) In 2’s complement representation, if the MSB is 1, the sign of the number is .
26) The 1 in the binary number 1000 has a place value of in decimal.
27) The letters ASCII stand for .
28) In a binary number system, the right-most bit is the significant bit
29) In binary addition, 1 + 1 equals .
30) In binary subtraction, 1 − 1 equals .
31) The complement of a binary number is found by simply changing all 1's to
0's and all 0's to 1's.
32) The -most bit in a signed binary number is the sign bit.
33) The two numbers in an addition are the and the augend.
34) The two numbers in a subtraction are the and the minuend.
35) BCD stands for coded decimal.
36) The Gray code exhibits a bit change from one code number to the next.
37) There are standard ASCII characters.
Answers:
1) EA0 2) Bit 3) ASCII 4)1111111 5) 127
6) 777 7) 157 8) 1961 9) 640 10) 10000 0110
11) 94 12) 26 13) 263 14) 1001010 15) 01011000
16) octal 17) 16 18) Gray 19) Excess-3 20) 16
21) 0111 22) +7 23) -1 24) sign 25) negative
3
26) 8 or 2 27) American 28) least 29) 10 30) 0
Standard Code for
Information
Interchange
31) 1’s 32) left 33) addend 34) subtrahend 35) binary
36) single 37) 128
Descriptive Type
1) What characteristic is most important about Gray code? (1)
2) What range of decimal values can be represented by a four-digit hex number? (1)
3) What do you mean by self-complementing code? (2)
4) Why is the excess-3 code used in some arithmetic circuits? (2)
5) Compare BCD and binary systems of coding. (2)
6) Convert 24CE16 to decimal. (4)
7) Convert 35278 to hex. (4)
8) Convert 10010111101101012 to hex. (4)
9) What is a BCD code? What are its advantages and disadvantages? (5)

You might also like