0% found this document useful (0 votes)
3 views20 pages

3.-number-system

The document provides an overview of various number systems including Base-N, Decimal, Binary, and Hexadecimal systems, detailing their digits and positional representations. It also includes definitions of data units such as byte and word, and methods for converting between Decimal, Binary, and Hexadecimal formats. Additionally, it explains the process of converting Decimal numbers to Binary and Hexadecimal using repeated subtraction and division methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
3 views20 pages

3.-number-system

The document provides an overview of various number systems including Base-N, Decimal, Binary, and Hexadecimal systems, detailing their digits and positional representations. It also includes definitions of data units such as byte and word, and methods for converting between Decimal, Binary, and Hexadecimal formats. Additionally, it explains the process of converting Decimal numbers to Binary and Hexadecimal using repeated subtraction and division methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 20

1

Base-N Number System


 Base N
 N Digits: 0, 1, 2, 3, 4, 5, …, N-1
 Example: 1045N
 Positional Number System
 n 1 4 3 2 1 0
N N N N N N
d n  1  d 4 d3 d 2 d1 d 0
• Digit do is the least significant digit (LSD).
• Digit dn-1 is the most significant digit (MSD).
2
Decimal Number System
 Base 10
 Ten Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
 Example: 104510
 Positional Number System

n 1 4 3 2 1 0
10 10 10 10 10 10
d n  1  d 4 d3 d 2 d1 d 0
 Digit d0 is the least significant digit (LSD).
 Digit dn-1 is the most significant digit (MSD). 3
Binary Number System
 Base 2
 Two Digits: 0, 1
 Example: 10101102
 Positional Number System
n 1 4 3 2 1 0
2 2 2 2 2 2
bn  1  b4 b3 b2 b1 b0
 Binary Digits are called Bits
 Bit bo is the least significant bit (LSB).
 Bit bn-1 is the most significant bit (MSB).
4
Definitions
 nybble = 4 bits
 byte = 8 bits
 (short) word = 2 bytes = 16 bits
 (double) word = 4 bytes = 32 bits
 (long) word = 8 bytes = 64 bits
 1K (kilo or “kibi”) = 1,024
 1M (mega or “mebi”) = (1K)*(1K) = 1,048,576
 1G (giga or “gibi”) = (1K)*(1M) = 1,073,741,824

5
Hexadecimal Number System
 Base 16
 Sixteen Digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
 Example: EF5616
 Positional Number System
 n 1 4 3 2 1 0
16 16 16 16 16 16
0000 0 0100 4 1000 8 1100 C
0001 1 0101 5 1001 9 1101 D
0010 2 0110 6 1010 A 1110 E
0011 3 0111 7 1011 B 1111 F
6
7
8
9
10
11
12
13
Number Conversions

14
Decimal to Binary Conversion
Method I:
Use repeated subtraction.
Subtract largest power of 2, then next largest, etc.

Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2n


Exponent: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , n
20 21 22 23 24 25 26 27 28 29 210 2n

15
Decimal to Binary Conversion

Suppose x = 156410
Subtract 1024: 1564-1024 (210) = 540  n=10 or 1 in the (210)’s position
Subtract 512: 540-512 (29) = 28  n=9 or 1 in the (29)’s position

28=256, 27=128, 26=64, 25=32 > 28, so we have 0 in all of these positions

Subtract 16: 28-16 (24) = 12  n=4 or 1 in (24)’s position


Subtract 8: 12 – 8 (23) = 4  n=3 or 1 in (23)’s position
Subtract 4: 4 – 4 (22) = 0  n=2 or 1 in (22)’s position

Thus:
156410 = (1 1 0 0 0 0 1 1 1 0 0)2
16
Decimal to Binary Conversion

Method II:
Use repeated division by radix.
2 | 1564 2|__24_
782
2|_____ R=0 12
2|_____ R=0


391
2|_____ R=0 6
2|_____ R=0
195
2|_____ R=1 3
2|_____ R= 0
97
2|_____ R=1 1 R=1
2|_____
48
2|_____ R=1 0 R=1
24 R = 0
Collect remainders in reverse order
11000011100
17
Binary to Hex Conversion

1. Divide binary number into 4-bit groups

01 1 0 0 0 0 1 1 1 0 0
Pad with 0’s
If unsigned number

2. Substitute hex digit for each group


Pad with sign bit
if signed number 61C16

18
Hexadecimal to Binary Conversion
Example

1. Convert each hex digit to equivalent binary

(1 E 9 C)16

(0001 1110 1001 1100)2

19
Decimal to Hex Conversion

Method II:
Use repeated division by radix.
16 | 1564
97
16|_____ R = 12 = C
6
16|_____
0
R=1
R=6 
N = 61C 16

20

You might also like