Uploaded by Nema Salem

ECE 251L Set 1 F20

advertisement
BASICS,
NUMERATION
SYSTEMS AND
CODES
CHAPTER 1
SET 1
ECE251L
Dr. Nema Salem
Fall 2020
1
DIGITAL LOGIC LEVELS
Logic
level:
A
voltage
level
that
represents a defined digital state in an
electronic circuit.
Logic HIGH (or logic 1): The higher of two
voltages in a digital system with two logic
levels.
Logic LOW (or logic 0): The lower of two
voltages in a digital system with two logic
levels.
Positive logic: A system in which logic LOW
represents binary digit 0 and logic HIGH
represents binary digit 1.
Negative logic: A system in which logic LOW
represents binary digit 1 and logic HIGH
represents binary digit 0.
ECE251L
Dr. Nema Salem
Fall 2020
2
POSITIVE LOGIC BINARY QUANTITIES
 Exact
voltage
level
is
not
important
in
digital systems.
 A voltage of
V will mean
same (binary
as a voltage
4.3 V.
3.6
the
1)
of
ECE251L
Dr. Nema Salem
Fall 2020
3
DIGITAL WAVEFORMS
HIGH
HIGH
Rising or
leading edge
LOW
Falling or
trailing edge
t0
Falling or
leading edge
LOW
t1
(a) Positive–going pulse
Rising or
trailing edge
t0
t1
(b) Negative–going pulse
ECE251L
Dr. Nema Salem
Fall 2020
4
PERIODIC PULSE WAVEFORMS
Periodic pulse waveforms are composed of
pulses that repeats in a fixed interval
called the period. The frequency is the
rate it repeats and is measured in hertz.
 Frequency,
 Period,
 Amplitude,
 Pulse width (tW)
 Duty cycle (the ratio of tW to T).
ECE251L
Dr. Nema Salem
Fall 2020
5
PERIODIC PULSE WAVEFORMS
Volts
Amplitude
(A)
Pulse
width
(tW)
Time
Period, T
1
f 
T
T
1
f
The clock is a basic timing signal that is
an example of a periodic wave.
What is the period of a repetitive wave if f = 3.2
GHz? 313 ps
ECE251L
Dr. Nema Salem
Fall 2020
6
PULSE DEFINITIONS
Actual pulses are not ideal but are
described by the rise time, fall time,
amplitude,
pulse
width,
and
other
characteristics.
Overshoot
Ringing
Droop
90%
Amplitude
tW
50%
Pulse width
10%
Ringing
Base line
Undershoot
tr
tf
Rise time
Fall time
ECE251L
Dr. Nema Salem
Fall 2020
7
PARALLEL AND SERIAL TRANSMISSION


Parallel transmission:
 8-bits
in a binary number are
transmitted simultaneously.
 A separate line is required for
each bit.
Serial transmission:
 each bit in a binary number is
transmitted
per
some
time
interval.
ECE251L
Dr. Nema Salem
Fall 2020
8
PARALLEL AND SERIAL TRANSMISSION:
SERIAL TRANSMISSION
Serial is slower but requires a
single path.
1 0 1 1 0 0 1 0
t0 t1 t2 t3 t4 t5 t6 t7
Computer
Modem
ECE251L
Dr. Nema Salem
Fall 2020
9
PARALLEL TRANSMISSION
Parallel transmission is faster but
requires a more paths.
1
Com puter
Printer
0
1
1
0
0
1
0
t0
ECE251L
t1
Dr. Nema Salem
Fall 2020
10
NUMBER SYSTEMS
 Decimal: 10 symbols (base 10)
 Binary: 2 symbols (base 2)
 Octal: 8 symbols (base 8)
 Hexadecimal: 16 symbols (base 16)
ECE251L
Dr. Nema Salem
Fall 2020
11
DECIMAL (BASE 10) SYSTEM
 10 symbols: 0, 1, 2, 3, 4, 5, 6 , 7, 8, 9
 Most significant digit/bit (MSD/MSB) and least
significant digit/bit (LSD/LSB)
 Positional value may be
multiplied by a power of 10
ECE251L
Dr. Nema Salem
stated
Fall 2020
as
a
digit
12
EXAMPLES
ECE251L
Dr. Nema Salem
Fall 2020
13
BINARY (BASE 2) SYSTEM
 2 symbols: 0,1
 Positional value may be stated as a
digit multiplied by a power of 2.
ECE251L
Dr. Nema Salem
Fall 2020
14
BINARY COUNTING
ECE251L
Dr. Nema Salem
Fall 2020
15
Binary
No. of bits
Min
Max
n
0
2n - 1
ECE251L
Dr. Nema Salem
Fall 2020
16
MSB AND LSB
 Most
significant
bit:
The
leftmost
bit
in
a
binary
number.
 This bit has the number’s
largest positional multiplier.
 Least significant bit: The
rightmost
bit
of
a
binary
number.
 This bit has the number’s
smallest positional multiplier.
ECE251L
Dr. Nema Salem
Fall 2020
17
Converting Binary to decimal
ON
ON
OFF
ON
OFF
1 0 0 1 12
Exponent:
Calculation:
16 0 0 2 1
1910
+
ECE251L
+
Dr. Nema Salem
+
Fall 2020
+
=
18
EXAMPLE
ECE251L
Dr. Nema Salem
Fall 2020
19
Converting Binary to decimal
OFF
OFF
ON
ON
OFF
1 1 0 0 02
Exponent:
Calculation:
16 8 0 0 0
2410
+
ECE251L
+
Dr. Nema Salem
+
Fall 2020
+
=
20
EXAMPLE
100101.01
25 24 23 22 21 20. 2-1 2-2
32 16 8 4 2 1 . ½ ¼
1 0 0 1 0 1. 0 1
32 +4 +1 +¼ = 37¼
ECE251L
Dr. Nema Salem
Fall 2020
21
CONVERTING DECIMAL TO BINARY
(BASE-10 TO BASE-2)
1.
2.
3.
Divide the decimal numbers by
2 and get the remainders
Repeat the division until the
number becomes zero
Read remainders from bottom to
top to get the bits
ECE251L
Dr. Nema Salem
Fall 2020
22
EXAMPLE
ECE251L
Dr. Nema Salem
Fall 2020
23
EXAMPLE
Integer
2
2
2
2
2
2
2
2
)
)
)
)
)
)
)
)
145
72
36
18
9
4
2
1
0
Remainder
---------------------------------
1
0
0
0
1
0
0
1
145 Dec = 10010001 Bin
ECE251L
Dr. Nema Salem
Fall 2020
24
EXAMPLE
Integer
2
2
2
2
2
2
)
)
)
)
)
)
41
20
10
5
2
1
0
Remainder
----- 1
----- 0
----- 0
----- 1
----- 0
------1
41 10 = 101001 2
ECE251L
Dr. Nema Salem
Fall 2020
25
CONVERTING DECIMAL FRACTIONS TO BINARY
 Repeatedly
fractional
multiplying
results
of
the
successive
multiplications by 2.
 Keep the carries form the binary
number until zero is reached.
ECE251L
Dr. Nema Salem
Fall 2020
26
EXAMPLE
Convert the
to binary.
decimal
fraction
0.188 x 2 = 0.376
carry = 0
0.376 x 2 = 0.752
carry = 0
0.752 x 2 = 1.504
carry = 1
0.504 x 2 = 1.008
carry = 1
0.008 x 2 = 0.016
carry = 0
MSB
Answer = .00110 (for
significant digits)
ECE251L
Dr. Nema Salem
Fall 2020
0.188
five
27
OCTAL NUMBERS
• Computer
scientists
are
often
looking
for
shortcuts to do things
BINARY – OCTAL
RELATIONSHIP
• One of the ways in which
we can represent binary
numbers is to use their
octal equivalents instead
• This is especially helpful
when we have to do fairly
complicated
tasks
using
numbers
• The octal numbering system
includes eight base digits
(0-7)
ECE251L
Dr. Nema Salem
Fall 2020
28
OCTAL TO DECIMAL
1. Multiply each octal digit by the exponential
expression that represents its placeholder
2. Add the products together. The sum represents the
Base (10) equivalent
23748
2 * 83
3 * 82
7 * 81
4 * 80
= 1024
= 192
=
56
=
4
1024 + 192 + 56 + 4 = 1276
ECE251L
Dr. Nema Salem
Fall 2020
23748 = 127610
29
OCTAL –TO DECIMAL CONVERSION
2
Exponential
Expression:
“Eights”
“Sixty-Fours”
Placeholder
Name:
Value:
4
1
“Ones
”
Number:
64*2
8*4
1*1
82*2
81*4
80*1
ECE251L
Dr. Nema Salem
Fall 2020
30
DECIMAL TO OCTAL
Integer
8 )
8 )
8 )
Remainder
153
19
2
0
----- 1
----- 3
----- 2
153)10 = 231)8
ECE251L
Dr. Nema Salem
Fall 2020
31
BINARY TO OCTAL
100011001010012
2 14 5 1
ECE251L
Dr. Nema Salem
Fall 2020
32
OCTAL TO BINARY
4
100
3
011
5
101
2
010
0
000
1000111010100002
ECE251L
Dr. Nema Salem
Fall 2020
33
HEXADECIMAL NUMBERING
 Hexadecimal uses sixteen
characters (Base 16) to
represent numbers: the
numbers 0 through 9 and
the
alphabetic
characters A through F.
HEXADECIMAL
NUMBERING
 It is a weighted number
system.
The
column
weights are powers of
16, which increase from
right to left.
 It is used in specifying
web colors
 Each
hex
digit
can
replace
four
binary
digits
ECE251L
Dr. Nema Salem
Fall 2020
34
EXAMPLES
BINARY TO HEXA
 1001 0110 0000 11102= ?16
960E
 1010 1100 0101 (binary) = AC5 (hex)
 10111 (bin) = 0001 0111 (binary) =
17 (hex)
ECE251L
Dr. Nema Salem
Fall 2020
35
EXAMPLES
HEXA TO BINARY
3F9 (hex) = 0011 1111 1001
(binary)
ECE251L
Dr. Nema Salem
Fall 2020
36
EXAMPLES
DECIMAL TO HEXA
16 )
214
13
------ 6
• 21410 = D616
• 182010 = 71C16
ECE251L
Dr. Nema Salem
Fall 2020
37
EXAMPLES
HEXA TO DECIMAL
• 1A2F16 =?10
ECE251L
Dr. Nema Salem
Fall 2020
38
EXERCISE
Convert the following binary numbers to decimal numbers:
A = 110101
C = 11110111101
B = 100110101
D = 101100001111
Convert from binary to decimal:
A = 10110.01
B = 111.111
C = 11110111.1011
D = 10110101101.111101
convert the following binary numbers in octal:
A = 10110101
B = 11010111.01
Convert the following binary numbers in hexadecimal.
A = 1101011101
B = 11101011101.11
a) Convert the following octal number to digital 5238.
b) Convert the following hexadecimal number to binary 4DC2 16.
ECE251L
Dr. Nema Salem
Fall 2020
39
convert the following octal number to decimal: A =
264.748
Convert the following octal number to decimal:
A = 4562.368 C = 264.3658
B = 523411.2328 D = 4516328
Is the number 12586 an octal number?
convert the following hexadecimal number to decimal:
A = 34DF.AC216
Convert from hexadecimal to decimal.
X = A23C.DF16
Y = 7D3E16
Z = D96EC.FA16
Convert the following decimal numbers to binary
A = 15310 C = 4610
B = 25510 D = 3810
Convert from decimal to binary
A = 17.37510 C = 27.87510
B = 43.62510 D = 49.4062510
ECE251L
Dr. Nema Salem
Fall 2020
40
Convert the following numbers from decimal to octal:
A = 32310 C = 12810
B = 45210 D = 9910
Convert from decimal to hexadecimal:
A = 452310 C = 99710
B = 86710 D = 123810
ECE251L
Dr. Nema Salem
Fall 2020
41
Download