Professional Documents
Culture Documents
E1.2 Digital Electronics I 2.1 7 Oct 2007 E1.2 Digital Electronics I 2.2 7 Oct 2007
– Many definitions are possible depending on context • Information can be very complicated
– e.g.:
• We will say that: • Numbers Sounds
• Pictures Codes
– data is a physical representation of information
– We need a simple electronic representation
• Data can be stored 5 Volts
• What can we do with electronics?
– e.g.: computer disk, cash till
– Set up voltages and currents
• Data can be transmitted – Change the voltages and currents R
– e.g.: fax
• A useful device is a switch
• Data can be processed – Switch Closed: V = 0 Volts
– e.g.: cash till Switch V
– Switch Open: V = 5 Volts
E1.2 Digital Electronics I 2.3 7 Oct 2007 E1.2 Digital Electronics I 2.4 7 Oct 2007
Number System Overview
• Information can be represented by a voltage level
• The simplest information is TRUE/FALSE
– This can be represented by two voltage levels:
• 5 Volts for TRUE
• 0 Volts for FALSE Octal
• A voltage signal which has only two possibilities is a BIT (base 8)
– Bit stands for Binary Digit
Decimal Binary
• Binary means: only 2 possible values (base 10) (base 2)
FALSE TRUE
(0) (1)
E1.2 Digital Electronics I 2.5 7 Oct 2007 E1.2 Digital Electronics I 2.6 7 Oct 2007
E1.2 Digital Electronics I 2.7 7 Oct 2007 E1.2 Digital Electronics I 2.8 7 Oct 2007
Binary Number System Integer and Fractional Parts
• Uses 2 symbols by our previous rule • Binary numbers can contain fractional parts as well as
– 0 and 1 integer parts
• Example: 10011 in binary is 4 3 2 1 0 -1 -2 -3
2 2 2 2 2 2 2 2
4 1 0 24 23 22 21 20
1 0 0 1 1 0 1 1
1 x 2 + 1 x 2 + 1 x 2 =19 1 0 0 1 1
Binary Point (19.375)10
• Binary is the base 2 number system
• This 8-bit number is in Q3 format
• Most common in digital electronics
– 3 bits after the binary point
• How could 19.376 best be represented using an 8-bit
binary number?
– Quantization error
E1.2 Digital Electronics I 2.9 7 Oct 2007 E1.2 Digital Electronics I 2.10 7 Oct 2007
50/2 = 25 0 LSB
50 10
= 32 + 18 34610 = 256 + 90 25/2 = 12 1
= 256 + 64 + 26
= 32 + 16 + 2 12/2 = 6 0
= 256 + 64 + 16 + 10
= 1× 2 + 1 × 2 + 1 × 2
5 4 1
= 256 + 64 + 16 + 8 + 2
6/2 = 3 0
50 10
= 110010 2
8 6 4
= 1× 2 +1× 2 +1× 2 +1× 2 +1× 23 1 3/2 = 1 1
34610 = 1010110102 1/2 = 0 1 MSB
5010=1100102
E1.2 Digital Electronics I 2.11 7 Oct 2007 E1.2 Digital Electronics I 2.12 7 Oct 2007
Conversion: binary to decimal Binary Addition
A 0 1 1 1
• Other algorithms can be used as alternatives if you
+ B 0 1 1 0
prefer Sum 1 1 0 1
E1.2 Digital Electronics I 2.13 7 Oct 2007 E1.2 Digital Electronics I 2.14 7 Oct 2007
Hexadecimal Numbers
• Note that we need to consider 3 inputs per bit of binary
number • Decimal, binary, and hexadecimal numbers
– A, B and carry-in
• Each bit of binary addition generates 2 outputs
– sum and carry-out
E1.2 Digital Electronics I 2.15 7 Oct 2007 E1.2 Digital Electronics I 2.16 7 Oct 2007
Hexadecimal Numbers conversions Binary Coded Decimal (BCD)
• Binary-to-hexadecimal conversion
1. Break the binary number into 4-bit groups
• Use 4-bit binary to represent one decimal digit
2. Replace each group with the hexadecimal equivalent • Easy conversion
• Wasting bits (4-bits can represent 16 different values,
but only 10 values are used)
• Hexadecimal-to-decimal conversion
1. Convert the hexadecimal to groups of 4-bit binary
• Used extensively in financial applications
2. Convert the binary to decimal
• Decimal-to-hexadecimal conversion
– Repeated division by 16
E1.2 Digital Electronics I 2.17 7 Oct 2007 E1.2 Digital Electronics I 2.18 7 Oct 2007
E1.2 Digital Electronics I 2.19 7 Oct 2007 E1.2 Digital Electronics I 2.20 7 Oct 2007
Gray Codes Gray Codes
E1.2 Digital Electronics I 2.21 7 Oct 2007 E1.2 Digital Electronics I 2.22 7 Oct 2007
ASCII code
• Codes representing
letters of the
alphabet,
punctuation marks,
and other special
characters as well
as numbers are
called alphanumeric
codes.
• The most widely
used alphanumeric
code is the
American Standard
Code for Information
Interchange(ASCII).
The ASCII
(pronounced
“askee”) code is a
seven-bit code.