Computer Number Systems PDF
Computer Number Systems PDF
Learning Outcomes
Explain why computer designers chose to
use the binary system for representing
information in computers.
Explain what a binary digit is.
Explain what a byte is.
Learning Outcomes
Computer Number Systems
Learning Outcomes
Associate electronic prefixes with their
meanings.
Identify the special quantities specified by
the terms kilobyte and megabyte.
Learning Outcomes
Identify the special code used to represent
alphanumeric characters in PCs.
Describe the parity method of detecting
data errors in PCs.
Why binary?
The original computers were designed to be
high-speed calculators.
The designers needed to use the electronic
components available at the time.
The designers realized they could use a
simple coding system--the binary system-to represent their numbers
Representing Information in
Computers
All the different types of information in
computers can be represented using binary
code.
Numbers
Letters of the alphabet and punctuation marks
Microprocessor instruction
Graphics/Video
Sound
Numbering Systems
Background Information
160 = 1
1,4820 = 1.
491 = 49
8271 = 827
Numbering Systems
10
10 10 10
1000 100 10 1
1
4
9 2
Numbering Systems
1492
1x
1000 =
4x
100 =
9x
10 =
2x
1=
1000
400
90
+
1492
Numbering Systems
Binary Numbers
The prefix bi- stands for 2
The binary number system is a Base 2
number system:
There are 2 symbols that represent quantities:
0, 1
Numbering Systems
8
3
2
1
4
2 1
2
1
0
2 2 2
0
1
1
Numbering Systems
1011
1x 8=
0x 4=
1x 2=
1x 1= + 1
11
Numbering Systems
128 64 32 16 8 4 2 1
7
2 2 2 2 2 2 2 2
1 0 1 1 0 1 0 1
Numbering Systems
16 8 4 2
1 0 1 0 1
Numbering Systems
16 8 4
2 1
1 0 1 0 1
16 +
4+
1 = 21
11
0 0 1 0 1 to decimal.
64
32 16
1
1 0
64 + 32 +
4 2 1
1 0 1
4 + 1=101
Numbering Systems
Numbering Systems
Numbering Systems
853
1024 512 256 128
64
32
16
Numbering Systems
853
1024 512 256 128
64
32
16
Numbering Systems
64
32
16
Numbering Systems
Numbering Systems
341
- 256
85
512 256 128
85
- 128
X
64
32
85
- 64
21
16
21
- 32
X
4
1 1 0 1 0 1 0 1 0 1
21
- 16
5
5
-8
X
5
-4
1
1
-2
X
1
-1
0
Numbering Systems
Numbering Systems
Step 2:
Use the remainder as the LEAST
SIGNIFICANT DIGIT of the binary number.
Numbering Systems
Step 4:
Use the remainder as the next digit of the binary
number.
Numbering Systems
Step 6:
Use the last remainder (the one that cant be
divided by 2) as the MOST SIGNIFICANT
digit.
Step 2:
The remainder of 1 becomes the LEAST
significant digit of the number.
1
Step 4:
The remainder of 0 becomes the next digit of
the number.
0 1
1 1 0 1 0 1 0 1 0 1
Step 6:
The final quotient of 1 comes down to be the
most significant digit.
Numbering Systems
Hexadecimal Numbers
The prefix hexa- stands for 6 and the
prefix deci- stands for 10
The hexadecimal number system is a Base
16 number system:
There are 16 symbols that represent quantities:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Numbering Systems
Hexadecimal Numbers
We use hexadecimal numbers as
shorthand for binary numbers
Each group of four binary digits can be
represented by a single hexadecimal digit.
Numbering Systems
Hexadecimal Numbers
Dec
Bin
Hex
Dec
Bin
Hex
0000
1000
0001
1001
0010
10
1010
0011
11
1011
0100
12
1100
0101
13
1101
0110
14
1110
0111
15
1111
Numbering Systems
Numbering Systems
Numbering Systems
Numbering Systems
Converting Hexadecimal
Numbers to Binary
Converting hexadecimal numbers to binary
is just the reverse operation of converting
binary to hexadecimal.
Just convert each hexadecimal digit to its
four-bit binary pattern. The resulting set of
1s and 0s is the binary equivalent of the
hexadecimal number.
Example of Hexadecimal to
Binary Conversion
Convert A3D7 to binary.
Numbering Systems
Decimal to Hexadecimal
Conversion
There are two methods to choose from:
Do a decimal-to-binary conversion and then a
binary-to-hexadecimal conversion.
Do a direct conversion using the repeated
division method.
Since this is a conversion to hexadecimal, 16 is the
divisor each time.
Step 2:
The remainder of 5 becomes the LEAST
significant digit of the number.
5
Step 4:
The remainder of 5 becomes the next digit of
the number.
5 5
3 5 5
Numbering Systems
Decimal to Hexadecimal
Conversion
Note:
Since you are dividing by 16 in the repeated
division method for decimal-to-hex conversion,
you could end up with remainders of anywhere
from 0 to 15.
If a remainder is 10 to 15, you convert it to the
single hex symbol when you add the digit to the
hex number youre building.
Another Decimal-to-Hex
Example
Let s convert decimal 60 to hexadecimal.
60 /16 = 3 Remainder 12
3C
The remainder of 12 is represented by its hex
symbol C in the resulting number and the
quotient of 3 cant be divided by 16 so it
comes down to be the most significant digit of
the hex number.
Numbering Systems
Hexadecimal Number
System
16
16 16 16
4096 256 16 1
2
F
A 4
Converting Hexadecimal
Numbers to Decimal
Multiply each digit of the hex number by
its place value and add the results.
For example, converting 2FA4
2 x 4096 = 8192
15 x 256 = 3840 (convert F to 15)
10 x 16 = 160 (convert A to 10)
4 x 1 =+_ 4
12,196
Electronics Prefixes
There is a set of of terms used in
electronics used to represent different
powers of ten.
There is a set of terms used to represent
large whole numbers and a set of terms
used to represent small fractional numbers.
Value
Abbreviation
Kilo
1,000
Mega
1,000,000
Giga
1,000,000,000
Tera
1,000,000,000,000
Value
Abbreviation
milli
1 / 1,000
micro
1 / 1,000,000
nano
1 / 1,000,000,000
pico 1 / 1,000,000,000,000
Examples of ASCII
Representation
Character
Code
Hex
0100 0001
41
0011 1111
3F
0011 1000
38
space
0010 0000
20
Parity Bits
There are two methods for checking parity:
Odd
Even
Odd Parity
The parity checking circuit counts the
number of 1 bits and adds the parity bit to
make the total number of 1 bits an ODD
number.
Examples
1 0 0 1 0 0 1 1 has four 1s so the parity bit
would be a 1
1 1 0 0 1 1 1 0 has five 1s so the parity bit
would be a 0
Even Parity
The parity checking circuit counts the
number of 1 bits and adds the parity bit to
make the total number of 1 bits an EVEN
number.
Examples
1 0 0 1 0 0 1 1 has four 1s so the parity bit
would be a 0
1 1 0 0 1 1 1 0 has five 1s so the parity bit
would be a 1
Summary