Professional Documents
Culture Documents
PHYS 324 DIGITAL ELECTRONICS Binary Numb
PHYS 324 DIGITAL ELECTRONICS Binary Numb
PHYS 324 DIGITAL ELECTRONICS Binary Numb
324 - ELECTRONICS
Prof. Dr. Ali S. Hennache
DIGITAL ELECTRONICS
Binary Number Systems
A Binary Number is made up of only 0s and 1s.
110100
There is no 2,3,4,5,6,7,8 or 9 in Binary
Binary Number
Words
The word binary comes from "Bi-" meaning two. We see "bi-" in
words such as "bicycle" (two wheels) or "binocular" (two eyes).
So, there are only two ways you can have a binary digit ("0" and "1",
or "On" and "Off") ... but what about 2 or more binary digits?
Let's write them all down, starting with 1 digit (you can test it yourself
using the switches):
1
4 ways to have two digits
0 → 00
0
1 → 01
0 → 10
1
1 → 11
8 ways to have three digits
0 → 000
0
1 → 001
0
0 → 010
1
1 → 011
0 → 100
0
1 1 → 101
1 0 → 110
1 → 111
0 → 0000
0
1 → 0001
0
0 → 0010
1
1 → 0011
0
0 → 0100
0
1 → 0101
1
0 → 0110
1
1 → 0111
0 → 1000
0
1 → 1001
0
0 → 1010
1
1 → 1011
1
0 → 1100
0
1 → 1101
1
0 → 1110
1
1 → 1111
Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Binary: 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111
(Or count in the same way as decimal numbers, but don't use
2,3,4,5,6,7,8 or 9.)
Exercise
10
111
10101
11110
Remember:
2^4| 2^3| 2^2| 2^1| 2^0
| | | 1 | 0
| | 1 | 1 | 1
1 | 0 | 1 | 0 | 1
1 | 1 | 1 | 1 | 0
Position
In the decimal System there are the Units, Tens, Hundreds, etc
Numbers can be placed to the left or right of the point, to indicate values greater than
one or less than one.
10.1
The number to the left of the point is a whole
number (10 for example)
Words
The word binary comes from "Bi-" meaning two. We see "bi-" in words
such as "bicycle" (two wheels) or "binocular" (two eyes).
This way people won't think it is the decimal number "101" (one
hundred and one).
The "1" on the left side is in the units position, so that means 1.
The 1 on the right side is in the "halves" position, so that means
1×(1/2)
1.1 is "1 and 1 half" = 1.5 in Decimal
2n < x, (n=1,2,3,...)
2. The high binary digit is equal 1:
dn = 1
3. Calculate the difference Δ of the number x and he power of 2, 2n:
Δ = x - 2n
4. Repeat step #1 with the difference until the result is 0.
Example
Convert x=13 to binary.
Solution
n=3, 23=8 < 13
n=4, 24=16 > 13
So
n=3
d3 = 1
Δ = 13 - 23 = 5
n = 2, x = Δ = 5
d2 = 1
Δ = 5 - 22 = 1
n = 1, x = Δ = 1
d2 = 0
n = 0, x = Δ = 1
d0 = 1
Δ=1-1=0
(d3d2d1d0) = 1101
So 13 in decimal is equal to 1101 in binary:
x = 1310 = 11012
Decimal Value 1 7 9 13 16 18 21 30 99
Binary 00 011 100 110 0001000 0001001 0001010 0001111 0110001
01 1 1 1 0 0 1 0 1
Decimal 145 238 363 475 532 688 760 879 999
Value
Binary 10010 1110 000 00011 0010000 0010101 0010111 0011011 0011111
001 1110 101 10110 10100 10000 11000 01111 00111
101 11
011
1110012 = 1·25+1·24+1·23+0·22+0·21+1·20 = 57
Exercise
power of 2:
PROF.ASH/AIMISIU/CS/DP/RUH/KSA/29.04.2014/23.47//