Number Systems Topic
Number Systems Topic
Xn
If n is 2 = binary, if n=8 octal, if n=16 hexadecimal, if n=10 decimal
N means subscript, base, radix
CONVERSION:
1. DECIMAL TO BINARY/OCTAL/HEXADECIMAL
3610 1001002
SUCCESSIVE DIVISION
36/2 = 18 rem=0
18/2=9 rem=0
9/2=4 rem=1
4/2=2 rem=0
2/2=1 rem=0
1/2=0 rem=1
===============
3610 448
36/8 = 4 rem=4
4/8=0 rem=4
===============
3610 2416
36/16 = 2 rem=4
2/16 =0 rem=2
2. BINARY/OCTAL/HEXADECIMAL TO DECIMAL
100100
0 x 20 = 0
0 x 21 = 0
1 x 22 = 4
0 x 23 = 0
0 x 24 = 0
1 x 25 = 32
---------
36
448 _______ 10
4 x 80 = 4
4 x 81 = 32
-------------
36
2416 ______10
4 x 160 = 4
2 x 161 = 32
-----------
36
Short method:
1 1 1 1 1 1 1 1 1 1 1
1 0 0 1 0 0
======================================================
210 29 28 27 26 25 24 23 22 21 20
1024 512 256 128 64 32 16 8 4 2 1
1 0 1 0 1 1 1 0 1
3. BINARY TO OCTAL/HEXADECIMAL
1100110112 6338
Octal (0-7) equivalent of 7 in binary 111 using 4-2-1 code
Using 3 bits
6 3 3
110 011 011
421 421 421
3 7 4 5 2 5
011 111 100 101 010 101
421 421 421 421 421 421
1100110112 19B16
Hexadecimal (0-F) equivalent of F is 15, 1111 using 8-4-2-1
Using 4 bits
1 9 11 = B
0001 1001 1011
8421 8421 8421
SEATWORK:
Convert the following: 5 points each
ARITHMETIC OPERATIONS
BINARY OPERATION
1. ADDITION
0+0=0
0+1=1
1+0=1
1 + 1 = 0 CARRY 1
1 + 1 + 1 = 1 CARRY 1
2. SUBTRACTION
0–0=0
0 – 1 = 1 BORROW 1
1–0=1
1–1=0
3. MULTIPLICATION
1 X0=0
1 X1=0
2 X0=0
2 X1=1
4. DIVISION
0/0=0
0/1=0
1/0=0
1/1=1
EXAMPLE:
PERFORM THE INDICATED OPERATIONS
1 1 1 1 1 1 1
1 1 1 0 1 0 1
+ 1 0 0 1 1 1 1
1 1 0 0 0 1 0 0
1
1 1 1
1 1 1 1 1
1 11 1 1 1 1 1
1 1 11 1 1 11 1
1 1 11 1 11 11 1 1 1 1
11 1 1 11 01 0 0 0
1 11 01 0 1 1 0 0
11 0 1 0 1 0 1 0
1 1 1 0 11 1 1 0
01 11 01 1 0 11 01 1
1 1 1 11 11 11 1 1
1 01 0 0 11 0 0 0
11 1 0 1 1 1 0 1
1 1 0 0 0 0 1 1 1 0 1
10 10 0 1 10 10 10 0 1
1 1 1 0 1 1 1 0
1 1 0 0 1 1 1 1
1 1 10 01 01 0 1 1 1
1 0 1 1 1 0 0 1
1 0 0 0 0 1 1 1 0
1 1 1 0 1 1 0 1
1 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1 1 1 0 1 1 0 1
1 1 1 0 1 1 0 1 0 0
Rem 1/10
1 1 1 0 0 1 0
10 1 1 1 0 0 1 0 1
1 0
1 1
1 0
1 0
1 0
0 1 0
1 0
1
Rem 1/101
1 0 1 1 1 0 0
101 1 1 1 0 0 1 1 0 1
1 0 1
1 0 0 0
1 0 1
1 1 1
1 0 1
1 0 1
1 0 1
0 1
1
36 1 0 0 1 0 0
- 15 + 1 1 0 0 0 0
21 1 0 1 0 1 0 0
DISREGARD
36 100100 (6 BITS)
15 001111
GET THE 1’S COMPLEMENT OF 15
110000
010100
+ 1
------------ --
0 1 0 1 0 1 (+21)
1 1 1 1 1
15 0 0 1 1 1 1
- 36 + 0 1 1 0 1 1
-21 1 0 1 0 1 0
Msb = negative
15 001111
36 100100
Get the 1’s complement of 36
011011
101010 (true value of negative 21)
Get the 1’s complement to get the true value of 21
ASSIGNMENT:
Perform the indicated operation:
11110010101 + 10101010 =
11111111 – 11001100 =
110000110011 – 1010101010 =
11110000 x 101 =
110011001100 / 110 =
100010001000 / 111 =
75-42 =
42-75 =