Sie sind auf Seite 1von 27

2-1 2-1

Digital Electronics
Principles & Applications
Eighth Edition
Chapter 2
Numbers We Use in
Digital Electronics
Roger L. Tokheim
2014 by McGraw-Hill Education. This is proprietary material solely for authorized instructor use. Not authorized for sale or distribution in
any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part.
2-2
INTRODUCTION
Counting in Decimal and Binary
Place Value
Binary to Decimal Conversion
Decimal to Binary Conversion
Electronic Translators
Application: DIY Encoder and Decoder
Hexadecimal Numbers
Octal Numbers
Bits, Bytes and Words
2-3
Counting in
Decimal and Binary
Number System -
Code using symbols that refer to
a number of items.

Decimal Number System -
Uses ten symbols (base 10 system)

Binary System -
Uses two symbols (base 2 system)
2-4 2-4
QUIZ
1. The __________ (binary, octal)
number system uses only the symbols 0
and 1 in counting.
2. The __________ (decimal,
hexadecimal) number system uses the
digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
3. The __________ (binary, decimal)
number system is also called the base 2
system because it uses only two symbols
to represent numbers.
binary
decimal
binary
2-5
Place Value
Numeric value of symbols in different positions.
Example - Place value in binary system:
Binary
8s 4s
2s
1s
Number
Place Value
Yes Yes No No
1 0 0 1
RESULT: Binary 1100 = decimal 8 + 4 + 0 + 0 = decimal 12
2-6
Binary to Decimal
Conversion
Convert Binary Number 110011
to a Decimal Number:
32 + 16 + 0 + 0 + 2 + 1 = 51
1 1 0 0 1 1

Decimal
Binary
2-7 2-7
QUIZ
Convert the following binary
numbers into decimal numbers:
Binary 1001 =
9
Binary 1111 =
Binary 0010 =
15
2
2-8
Decimal to Binary Conversion
Divide by 2 Process
Decimal # 13 2 = 6 remainder 1
6 2 = 3 remainder 0
3 2 = 1 remainder 1
1 2 = 0 remainder 1
1 1 0 1
Divide-by-2 Process
Stops When
Quotient Reaches 0
2-9 2-9
QUIZ
Convert the following decimal
numbers into binary:
Decimal 11 =
Decimal 4 =
Decimal 17 =
1011
0100
10001
2-10
Electronic Translators
Devices that convert from decimal to
binary numbers and from binary to
decimal numbers.
Encoders -
translates from decimal to binary
Decoders -
translates from binary to decimal
2-11 2-11
Electronic Encoder
Decimal to Binary
0
Decimal
to
Binary
Encoder
Binary output
Decimal input
0 0 0 0
5
0 1 0 1
7
0 1 1 1
3
0 0 1 1
Encoders are available in IC form.
This encoder translates from decimal
input to binary (BCD) output.
2-12 2-12
Binary-to-
7-Segment
Decoder/
Driver
Electronic Decoding
Binary to Decimal
Binary input
0 0 0 0
Decimal output
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
Electronic decoders are available in IC form.
This decoder translates from binary to decimal.
Decimals are shown on an 7-segment LED display.
This decoder also drives the 7-segment display.
2-13 2-13
QUIZ
1. The general name for an electronic device
that translates from binary to decimal is a(n)
__________.
2. The general name for an electronic device
that translates from decimal to binary is a(n)
__________.
decoder
encoder
3. An electronic device called a(n) __________
(decoder, encoder) would probably be
located between the keypad of a calculator
and its processing circuitry to translate from
decimal to machine language (binary).
encoder
2-14 2-14
Application: DIY Encoder and Decoder
(Block Diagram)
Processing
(invert to
true binary)

7404 IC
Decoder
Binary-to-
Decimal

7447 IC
Encoder
(decimal-to-
inverted binary)

74147 IC

Keypad

0 thru 9
in decimal
7-segmnent
LED
Display


INPUT
(decimal)
OUTPUT
(decimal)
PROCESSING
(in binary)
A DIY (do-it-yourself) circuit with (1) decimal input from keypad, (2) encoding from
decimal to inverted binary, (3) inverted to true binary, (4) decoded from binary-to-7-
segment code, and (5) appears in decimal on a LED display.

Decimal INPUT from keypad. One active-LOW input (0-9) passed to active-LOW inputs
of the 74147 encoder TTL IC.


Decimal INPUT from keypad. One active-LOW input (0-9) passed to active-LOW inputs
of the 74147 encoder TTL IC. The 74147 encoder IC translates the decimal input to and
inverted binary (like decimal 7 = 1000 inverted binary instead of 0111 in binary).

Inverted binary is translated to true binary by the 7404 inverter TTL IC. For instance,
decimal 6 = 1001 in inverted binary = 0110 in binary.


The 7447 decoder/driver IC translates from binary input to the 7-segment code. The 7447
TTL IC translates and drives the proper segment of the 7-segment display to show the
correct decimal number (0 thru 9).

The LED display is driven by the 7447 IC. The 7447 IC also activates the proper LED
segments of the display. For instance, press decimal 2 on the keypad and the proper
segments of the display will read decimal 2.

2-15 2-15
Application: DIY Decoder and Encoder Circuit
(Logic Circuit)
This is a logic diagram you could use in the lab to wire the DIY
decoder/encoder circuit.
Decimal
Input
Encoder
74147
IC
Inverters
7404
IC
Decoder
7447
IC
Decimal
Output
Inverted
binary
True
binary
7-segment
code
2-16 2-16
Uses 16 symbols - Base 16 System
0-9, A, B, C, D, E, F
Decimal
1
9
10
15
16
Binary
0001
1001
1010
1111
10000
Hexadecimal
1
9
A
F
10
Hexadecimal Number System
2-17 2-17
QUIZ

Q1 The 74147 IC is an electronic encoder that translates
from a decimal input to 4-bit _____ (ASCII, inverted
binary).


A1: Inverted binary
Q2 The 7404 IC contains logical inverters which convert
the input (inverted binary) to 4-bit _____ (binary,
octal) code.



A2: binary
Q3 The 7447 IC is a decoder that translates from 4-bit
binary to 7-segment code and activates the correct LED
segments lighting the correct decimal number. (T or F)



A3: True
Q4 When the 3 switch on the keypad is activated the 74147
encoder IC generates what 4-bit inverted binary code?




A4: 1100
Q5 When the 3 switch on the keypad is activated the 7404
IC (inverters) generates what 4-bit binary number?




A5: 0011
2-18 2-18
Hexadecimal to Binary Conversion
Hexadecimal C 3
Binary 1100 0011
Binary 1110 1010
Hexadecimal E A
Binary to Hexadecimal Conversion
Hexadecimal and Binary
Conversions
2-19 2-19
Decimal to Hexadecimal Conversion
Divide by 16 Process
Decimal # 47 16 = 2 remainder 15
2 16 = 0 remainder 2
F 2
Divide-by-2 Process
Stops When
Quotient Reaches 0
2-20 2-20
Hexadecimal to Decimal Conversion
Convert hexadecimal number
2DB to a decimal number
512 + 208 + 11 = 731
2 D B
Hexadecimal
Decimal
Place Value 256s 16s 1s
(256 x 2) (16 x 13) (1 x 11)
2-21 2-21
QUIZ
Convert Hexadecimal number A6 to Binary
Convert Hexadecimal number 16 to Decimal
Convert Decimal 63 to Hexadecimal
63 =
16 =
A6 = 1010 0110 (Binary)
22 (Decimal)
3F (Hexadecimal)
2-22 2-22
Octal Numbers
Uses 8 symbols - Base 8 System
0, 1, 2, 3, 4, 5, 6, 7
Decimal
1
6
7
8
9
Octal
1
6
7
10
11
Binary
001
110
111
001 000
001 001
2-23 2-23
QUIZ
1. The octal number 7 equals ______ in binary.
2. The octal number 11 equals ______ in binary.
3. The decimal number 23 equals ______ in binary.
4. The decimal number 23 equals ______ in octal.
6. The octal number 37 equals ______ in decimal.
111
001 001
010 111
27
31
5. The octal number 37 equals ______ in binary. 011 111
2-24 2-24
Practical Suggestion on
Number System Conversions
Use a scientific calculator
Most scientific calculators have DEC, BIN,
OCT, and HEX modes and can either
convert between codes or perform
arithmetic in different number systems.
Most scientific calculators also have other
functions that are valuable in digital
electronics such as AND, OR, NOT,
XOR, and XNOR logic functions.
2-25 2-25
Groupings of Binary Digits
Bit 1-bit (0 or 1)
Nibble 4-bits (such as 1101)
Byte 8-bits (such as 1100 0111)
Word 16-bits (common definition)
Double-word 32-bits
Quad-word 64-bits
2-26 2-26
QUIZ
1. A 4-bit grouping of binary digits is called a
_____ (byte, nibble).
2. An byte refers to an a(n) _____ (8, 64)-bit
group of binary digits.
3. A single binary digit (such as a 0 or 1) is called a
_____ (bit, nibble).
4. A common definition for a word in computer
jargon is a _____ (1, 16)-bit group of binary
digits.
nibble
8
bit
16
2-27
REVIEW
Counting in Decimal and Binary
Place Value
Binary to Decimal Conversion
Decimal to Binary Conversion
Electronic Translators
Application: DIY Encoder and Decoder
Hexadecimal Numbers
Octal Numbers
Bits, Bytes and Words

Das könnte Ihnen auch gefallen