1
2
2
+1
=3
HOW THE COMPUTER GETS
THE ANSWER
3
A computer understands
information composed of only zeros and
ones.
The decimal number system is
convenient for the programmer.
The computer uses binary digits for its
operation.
0
1
0
1
1
0
1
1
0
0
1
0
BASIC
NUMBER
SYSTEM
DECIMAL
HEXA
DECIMAL
OCTAL
BINARY
4
DECIMAL NUMBER SYSTEM
5
• 0,1,2,3,4,5,6,7,8,9.
DIGITS
• 10
BASE
6
8*10
9*10
5*10
4*10
DECIMAL NUMBER 4598
0
1
2
3
7
BINARY NUMBER SYSTEM
•0,1
DIGITS
•2
BASE
8
BINARY NUMBER 1011
1*2
1*2
0*2
1*2
0
1
2
3
9
HEXADECIMAL NUMBER
SYSTEM
•0,1,2,3,4,5,6,7,
•8,9,A,B,C,D,E,F.
DIGITS
•16
BASE
10
HEXADECIMAL NUMBER 1A5D
D*16
5*16
A*16
1*16
0
1
2
3
11
OCTAL NUMBER SYSTEM
•0,1,2,3,4,
•5,6,7,8.
DIGITS
•8
BASE
12
OCTAL NUMBER 5273
3*8
7*8
2*8
5*8
0
1
2
3
13
CONVERSIONS IN BASIC
NUMBER SYSTEM
14
BINARY TO DECIMAL
• 1 0 1 0 1
BINARY
• 5 4 3 2 1
BIT
POSITION • 1*2 +0*2 +1*2
+0*2 +1*2.
MUL WITH
BASE
• 21
DECIMAL
4 3 2
1 0
15
HEXADECIMAL TO DECIMAL
•5A9
HEX
•3 2 1
BIT POSITION
• 5*16
+A*16
+9*16
MUL WITH
BASE
•1449
DECIMAL
2
1
0
16
OCTAL TO DECIMAL
•645
OCTAL
•3 2 1
BIT
POSITION
•6*8 +4*8
+5*8.
MUL WITH
BASE
•421
DECIMAL
2 1
0
17
DECIMAL TO BINARY
• Q=19
• R=1
39 • Q=9
• R=1
19 • Q=4
• R=1
9 • Q=2
• R=0
4 • Q=1
• R=0
2 • Q=0
• R=1
1
LSB MSB
Divide through out by 2
DECIMAL = 39
BINARY = 100111
18
DECIMAL TO HEX
• Q=2
• R=3
35 • Q=0
• R=2
2
Divide through out by 16
LSB MSB
DECIMAL = 35
HEX = 23
19
DECIMAL TO OCTAL
• Q=57
• R=5
461
• Q=7
• R=1
57
• Q=0
• R=7
7
Divide through out by 8
LSB MSB
DECIMAL = 461
OCTAL = 715
20
BINARY TO HEXADECIMAL
BINARY
• (010111011001)
4BITS DIV
• (0101)(1101)(1001)
HEX
• (5) (D) (9) =(5D9)
2 16
21
BINARY TO OCTAL
BINARY
• (101111100)
3BIT DIV
• (101)(111)(100)
OCTAL
• (5) (7) (4)
=(574)
2
8
22
HEXADECIMAL TO BINARY
HEX
• (5C)
EXPANSION
• (0101)(1100)
BINARY
• (01011100)
16 2
23
OCTAL TO BINARY
OCTAL
• (436)
EXPANSION
• (100)(011)
BINARY
• (100011)
8 2
24
HEXADECIMAL TO OCTAL
• (4DF)
HEX
• (0100)(1101)(1111)
EXP
• (010011010000)
BINARY
• (010)(011)(011)(111)
3BIT DIV
• (2337)
OCTAL
16
2
8
25
OCTAL TO HEXADECIMAL
• (456)
OCTAL
• (100)(101)(110)
EXP
• (100101110)
BINARY
• (0001)(0010)(1110)
4BIT DIV
• (12E)
HEX
8
2
16
26
REPRESENTATION OF NEGATIVE
NUMBER
9’S & 10’S COMPLIMENT
• DECIMAL NUMBER SYSTEM
1’S & 2’S COMPLIMENT
• BINARY NUMBER SYSTEM
27
BINARY ARITHMETIC
1
• BINARY ADDITION
2
• BINARY SUBTRACTION
3
• BINARY MULTIPLICATION
4
• BINARY DIVISION
28
0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = 0 1 (Carry bit)
BINARYADDITION
1 1 0 1 (13 decimal)
+0 0 0 1 (+1 decimal)
1 1 1 0 (14 decimal)
29
BINARY SUBTRACTION
0 ‐ 0 = 0
1 ‐ 0 = 1
0 ‐ 1 = 1 1 (Carry bit)
1 ‐ 1 = 0
1 1 0 1 (13 decimal)
+ 0 0 1 1 (-3 decimal)
1 0 1 0 (10 decimal)
Borrow
30
1 0 0 0 =810
X 0 1 1 0 =610
0 0 0 0
+ 1 0 0 0
+ 1 0 0 0
+ 0 0 0 0
0 1 1 0 0 0 0 = 4810
BINARY MULTIPLICATION
31
BINARY DIVISION
011 ) 0 1 1 0 0 1 0 ( 1
0 1 1
0 0 0 (0
0 0 0
0 0 0 (0
0 0 0
0 0 1 (0
0 0 0
0 1 0
Q=1000=1610
R=10= 210
32
SIGNED ARITHMETIC OPERATION
MSB bit is reserved to represent the sign of
the number.
When the number is negative, the sign bit is
kept one.
When the number is positive, the sign bit is 0.
In 8-bit processor, MSB = sign bit & other 7
bits = number.
In 16-bit processor, MSB = sign bit & other
15 bits = number.
33
EXAMPLES
0 0 0 0 0 1 0 1 (+5 decimal)
0 0 0 0 0 1 0 0 (+4 decimal)
0 0 0 0 1 0 0 1 (+9 decimal)
0 0 0 0 0 1 0 1 (+5 decimal)
1 0 0 0 0 0 1 0 (-2 decimal)
1 1 1 1 1 1 0 1 (1’comp of -2)
1 1 1 1 1 1 1 0 (2’s comp of -2)
0 0 0 0 0 0 1 1 (+3 decimal)
1
2
1 2 1
34
BCD AND GRAY CODE
35
LOGIC GATES
Logic gates perform basic logical functions.
They are fundamental building blocks of
digital integrated circuits.
Most logic gates take an input of two binary
values, and output a single value of a 1 or 0.
 Some circuits may have only a few logic
gates, while others, such as microprocessors,
may have millions of them.
There are seven different types of logic gates,
which are outlined.
36
37
38
39
40
41
42
43
FLIP-FLOPS
A flip-flop or latch is a circuit that has two
stable states and can be used to store state
information.
Each flip-flop stores one bit of information
44
THANK YOU

Number System