Академический Документы
Профессиональный Документы
Культура Документы
Introduction
Salekul Islam
United International University
U
I
U
Base conversions
o
o
o
o
Binary Codes
Binary Coded Decimal (BCD)
Binary arithmetic
o
o
o
3/25/15
Decimal Binary
Any base Decimal
Octal Binary
Hexadecimal Binary
U
I
U
231.45 =
Here, 10 is called the radix or base of the number
system
In 10-base systems, there are 10 symbols (0, 1, ,
9)
In n-base system, there are n symbols (0, 1, , n-1)
In binary (2-base) system, there are 2 symbols (0, and
1)
U
I
U
Decimal to Binary
U
I
U
Hence, 14 = 1110
For fractional part, we have to divide by or
multiply by 2.
U
I
U
3/25/15
Conversion Details
U
I
U
U
I
U
Convert 46 to Base 2
3/25/15
U
I
U
3/25/15
U
I
U
CSE 257
Numerical Method
10
U
I
U
0.65 = 0.1010011001001
The fractional part begins repeating every 4 steps
yielding repeating 1001 forever!
3/25/15
11
U
I
U
3/25/15
12
Positive Powers of 2
U
I
U
3/25/15
Exponent Value
11
2,048
12
4,096
13
8,192
14
16,384
15
32,768
16
65,536
17
131,072
18
262,144
19
524,288
20
1,048,576
21
2,097,152
13
U
I
U
Name
Radix
Digits
Binary
0,1
Octal
0,1,2,3,4,5,6,7
Decimal
10
0,1,2,3,4,5,6,7,8,9
Hexadecimal
16
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
3/25/15
14
U
I
U
3/25/15
Decimal
(Base 10)
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
Binary
(Base 2)
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
Octal
(Base 8)
00
01
02
03
04
05
06
07
10
11
12
13
14
15
16
17
20
Hexadecimal
(Base 16)
00
01
02
03
04
05
06
07
08
09
0A
0B
0C
0D
0E
0F
10
15
Octal Binary
U
I
U
CSE 257
Numerical Method
16
Octal Binary
U
I
U
3/25/15
Octal to Binary:
o
Binary to Octal:
o
Group the binary digits into three bit groups starting at the
radix point and going both ways, padding with zeros as
needed in the fractional part.
Convert each group of three bits to an octal digit.
17
U
I
U
Instead of converting binary to decimal
Faster process is binary to octal to decimal
CSE 257
Numerical Method
18
Hexadecimal Binary
U
I
U
CSE 257
Numerical Method
19
Hexadecimal Binary
U
I
U
CSE 257
Numerical Method
20
U
I
U
3/25/15
21
U
I
U
Flexibility of representation
o
Information Types
o
3/25/15
22
U
I
U
3/25/15
110
111
23
U
I
U
3/25/15
24
U
I
U
3/25/15
25
U
I
U
3/25/15
8,4,2,1
0
1
2
3
4
5
6
7
8
9
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
Excess3 8,4,-2,-1
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
0000
0111
0110
0101
0100
1011
1010
1001
1000
1111
26
Gray
0000
0100
0101
0111
0110
0010
0011
0001
1001
1000
U
I
U
3/25/15
27
U
I
U
3/25/15
28
Binary Arithmetic
U
I
U
3/25/15
29
U
I
U
Carry in (Z) of 1:
3/25/15
Z
X
+Y
0
0
+0
0
0
+1
0
1
+0
0
1
+1
CS
00
01
01
10
Z
X
+Y
1
0
+0
1
0
+1
1
1
+0
1
1
+1
CS
01
10
10
11
30
U
I
U
3/25/15
31
BCD Arithmetic
U
I
U
3/25/15
32
U
I
U
3/25/15
33
U
I
U
3/25/15
34