Professional Documents
Culture Documents
Course: Computer Fundamental Instructor: Dr. Arif Mushtaq Topic: Number Systems-1 Systems-
Information Representation
There are two types of information representation.
External representation Internal representation
External Representation:- of information is the way Representation:that how the information is represented by the humans and the way it is entered at a keyboard or displayed on a printer or screen. Internal Representation:- of information is the way Representation:it is stored in the memory of a computer or passed to any device of computer.
Number Systems
The on and off states of the capacitors in RAM can be thought of as the values 1 and 0, respectively. Therefore, thinking about how information is stored in RAM requires knowledge of the binary (base 2) number system. Lets review the decimal (base 10) number system first.
Number Systems
Decimal Number System
Base is 10 or D or Dec Ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each place is weighted by the power of 10 Example: 123410 or 1234D = 1 x 103 + 2 x 102 + 3 x 101 + 4 x 100 = 1000 + 200 + 30 + 4
$1,000 $100 $10 $1
5 6 2 1
103 102 101 100
= 1 = 20 = 600 = 5000
17
div-by-2
8
div-by-2
4
div-by-2
2
div-by-2
1
div-by-2
Remainder
+ 0 x 20
Some Exercises
13D = (?) B 1101B 23D = (?) B
1000102 1 x 25 + 0 x 24 + 0 x 23 + 0 x 22+ 1 x 21 + 0 x 20
32 +
+ 0
+ 2
+ 0
3410
72D = (?) B
Some Exercises
Ex: 0101B
Bit 4 23 = 8
(?)D
Bit 3 22 = 4 Bit 2 21 = 2
1 4
0 +
1 1 = 5D
Ex: 1100B
(?)D
a 0 0 1 1
b 0 1 0 1
a+b 0 1 1 10
Carry bit
1 1 0 0 8 4 2 1 = 12D
(?)D
1
16
1 1 +
1 1 0 1b 0 1 0 1b 1 0 0 1 0b 1 1 1
1
64
0
32
1
8
1
4
0
2
0
1
If a = 15D, b = 10D
= 92D
1 1 1 1b + 1 0 1 0b 1 1 0 0 1b
Repeated division by 16
Hexadecimal to Decimal
(an-1an-2a1a0)16 = (an-1 x 16n-1 + an-2 x 16n-2 + + a1 x 161 + a0 x 160 )D Example: (1C7)16 = (1 x 162 + 12 x 161 + 7 x 160 )10
= (256 + 192 + 7)10 = (455)10
(33D)16
Hexadecimal Conversions
Hexadecimal to Binary
Expand each hexadecimal digit to 4 binary bits.
Example: (E29)16 = (1110 | 0010 | 1001)2
Binary to Hexadecimal
Combine every 4 bits into one hexadecimal digit
Example: (0101 | 1111 | 1010 | 0110)2 = (5FA6)16
Practice Questions
1) Convert the following binary numbers to decimal numbers:
(a) (b) (c) (d) 0011 B 0101 B 0001 0110 B 0101 0011 B
Practice Questions
3) Convert the following binary/dec numbers to hexadecimal numbers:
(a) (b) (c) (d) (a) (b) (c) 0011 B 0101 B 0001 0110 B 0101 0011 B 21 D 731 D 1,023 D
4.) Perform the following binary additions and subtractions. Show your work without using decimal numbers during conversion.
(a) (b) 111 B + 101 B 1001 B + 11 B
A C
01000001
A
Screen