Sie sind auf Seite 1von 35

Binary-Coded Decimal (BCD)

• If each digit in a decimal is represented by its


binary equivalent, we obtain a code called the
binary-coded decimal or BCD.
• Since each decimal digit has a value ranging
from 0 to 9, therefore the binary code must
consist of four bits.
• The following slide gives the codes for the
decimal digits from 0 to 9.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Binary-Coded Decimal (BCD)
• In BCD each digit in a decimal number is
represented by its binary equivalent
• Since each decimal digit has a value ranging
from 0 to 9, therefore the binary code must
consist of four bits:
Decimal 0 1 2 3 4 5 6 7 8 9
BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Notice that the four-bit binary codes 1010, 1011, 1100, 1101, 1110, and 1111 carry no meaning and
are forbidden in BCD. The use of any of these codes gives rise to an error in the BCD.

• Example: 36510 is written in BCD as 0011 0110 0101.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


ASCII Code
• In order to be able to code letters, numbers and
other symbols we require a code for
alphanumeric characters.
• One such alphanumeric code is the American
Standard Code for Information Interchange
(ASCII).
• A seven-bit code covers all the characters and
because of this it is often called the seven-bit
ASCII code.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Lecturer: Ben Horan SEE103: Electronics March 11, 2015
Lecturer: Ben Horan SEE103: Electronics March 11, 2015
Example
This will enter a single
blank space between
two characters

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


ASCII Code
• To specify a letter or symbol, first write down the
binary number of the column (X) in which it is
placed and then write down the binary number
of its row (Y).
• For example the code for the letter G is
100 0111
(usually this is written without the space).

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


ASCII Code
• An simple example of the use of ASCII code in a
digital system (computer) is Windows notepad
• Notepad represents the ASCII characters for
underlying binary numbers in .txt text files

For the character ‘a’ the file must


contain binary
1100001

To convert to hex 0110 0001

6 1 = 6116

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


ASCII Code
In Class Exercise
• Take the handout with the ASCII codes
• Now that we can convert from
– Hex to binary
– and from binary to ASCII
• Look at the hex codes and determine what is
written in the ASCII_decode.txt
• Example 4916
‘I’
0100 1001
Lecturer: Ben Horan SEE103: Electronics March 11, 2015
Parity and Error Detection
• When data is transmitted errors can occur, that is a 0
can be read as a 1 or vice versa.
• One of the simplest methods to detect such errors is
based on the parity of the code group or word (byte)
being transmitted.
• An extra bit called the parity bit is added to each
word.
• The parity bit becomes part of the word thus making
the 7-bit code into an 8-bit code.
• If a receiver in an even parity system receives a word
with an odd number of 1s it detects that an error has
occurred.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Parity and Error Detection cont.
• In an even parity system, the parity bit is
chosen so that the number of 1s in the
word is even.
For example: the code for the letter ‘k’ in an even parity
system would become 11101011 whilst that for ‘S’ would
become 01010011.

• For an odd-parity system the parity bit is


chosen to make the number of 1s odd.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Parallel Data Transfer
• Digital electronic systems are designed to
handle information in words of a specified
length. For example 8-bit, 16-bit or 32-bit word
lengths are commonly used.
• In parallel data transfer between two
components of a digital system, there are as
many lines connecting the two components as
there are bits in each word.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Parallel Data Transfer
• For example in transferring the letter ‘F’
(11000110) between a computer and a printer in
an 8-bit even parity system, there would be eight
data lines

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Serial Data Transfer
• In serial data transfer between two components
of a digital system, there is only one data line
connecting the two components. The bits are
sent one after the other.

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Serial Data Transfer
• Parallel data transfer has the advantage of
speed and is widely used in computer systems.
Serial data transfer has the advantage of having
simpler circuitry and hence being cheaper.
• As an example: We might remember 56.6Kbps
dial up modems
• These devices would communicate data serially
at a rate of 56,600 bits per second.
• Relatively this is very slow for a digital system

Lecturer: Ben Horan SEE103: Electronics March 11, 2015


Introduction to Chapter 3
 Now that we understand the concept of binary
numbers, we will study ways of describing
how systems using binary logic levels make
decisions.
 Boolean algebra is an important tool in
describing, analyzing, designing, and
implementing digital circuits.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved.
3-1 Boolean Constants and Variables
 Boolean algebra allows only two values; 0
and 1.
 Logic 0 can be: false, off, low, no, open
switch.
 Logic 1 can be: true, on, high, yes, closed
switch.
 Three basic logic operations: OR, AND, and
NOT.
Ronald Tocci/Neal Widmer/Gregory
Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved.
3-2 Truth Tables
 A truth table describes the relationship
between the input and output of a logic
circuit.
 The number of entries corresponds to the
number of inputs. For example a 2 input table
would have 22 = 4 entries. A 3 input table
would have 23 = 8 entries.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved.
3-2 Truth Tables
 Examples of truth tables with 2, 3, and 4 inputs.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-3 OR Operation With OR Gates
 The Boolean expression for the OR operation is
X=A+B
 This is read as “x equals A or B.”
 X = 1 when A = 1 or B = 1.
 Truth table and circuit symbol for a two input OR
gate:

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-3 OR Operation With OR Gates
 The OR operation is similar to addition but
when A = 1 and B = 1, the OR operation
produces 1 + 1 = 1.
 In the Boolean expression
x=1+1+1=1
We could say in English that x is true (1) when A is true
(1) OR B is true (1) OR C is true (1).

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-3 OR Operation With OR Gates
 There are many examples of applications
where an output function is desired when
one of multiple inputs is activated.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2004 by Pearson Education, Inc.
Digital Systems: Principles and Upper Saddle River, New Jersey 07458
Applications, 9e All rights reserved.
3-4 AND Operations with AND gates
 The Boolean expression for the AND operation is
X=A•B
 This is read as “x equals A and B.”
 x = 1 when A = 1 and B = 1.
 Truth table and circuit symbol for a two input AND gate
are shown. Notice the difference between OR and AND
gates.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-4 AND Operation With AND Gates
 The AND operation is similar to
multiplication.
 In the Boolean expression
X=A•B•C
X = 1 only when A = 1, B = 1, and C = 1.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-5 NOT Operation
 The Boolean expression for the NOT
operation is

X=A
 This is read as:
 x equals NOT A, or
 x equals the inverse of A, or
 x equals the complement of A
Ronald Tocci/Neal Widmer/Gregory
Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-5 NOT Operation
 Truth table, symbol, and sample waveform for
the NOT circuit.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-6 Describing Logic Circuits Algebraically
 The three basic Boolean operations (OR,
AND, NOT) can describe any logic circuit.
 If an expression contains both AND and OR
gates the AND operation will be performed
first, unless there is a parenthesis in the
expression.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-6 Describing Logic Circuits Algebraically
 Examples of Boolean expressions for logic
circuits:

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2004 by Pearson Education, Inc.
Digital Systems: Principles and Upper Saddle River, New Jersey 07458
Applications, 9e All rights reserved.
3-6 Describing Logic Circuits Algebraically
 The output of an inverter is equivalent to the
input with a bar over it. Input A through an
inverter equals A.
 Examples using inverters.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-7 Evaluating Logic Circuit Outputs
 Rules for evaluating a Boolean expression:
 Perform all inversions of single terms.
 Perform all operations within parenthesis.
 Perform AND operation before an OR operation
unless parenthesis indicate otherwise.
 If an expression has a bar over it, perform the
operations inside the expression and then invert
the result.
Ronald Tocci/Neal Widmer/Gregory
Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-7 Evaluating Logic Circuit Outputs
 Evaluate Boolean expressions by substituting
values and performing the indicated
operations:
A = 0, B = 1, C = 1, and D = 1
x = ABC(A + D)
= 0 ⋅1 ⋅1 ⋅ (0 + 1)
= 1 ⋅1 ⋅1 ⋅ (0 + 1)
= 1 ⋅1 ⋅1 ⋅ (1)
= 1 ⋅1 ⋅1 ⋅ 0
Ronald Tocci/Neal Widmer/Gregory
=0
Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved...
3-7 Evaluating Logic Circuit Outputs
 Output logic levels can be determined directly
from a circuit diagram.
 Technicians frequently use this method.
 The output of each gate is noted until a final
output is found.

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2004 by Pearson Education, Inc.
Digital Systems: Principles and Upper Saddle River, New Jersey 07458
Applications, 9e All rights reserved.
3-8 Implementing Circuits From
Boolean Expressions
 It is important to be able to draw a logic circuit from a
Boolean expression.
 The expression
x = A ⋅B⋅C
could be drawn as a three input AND gate.
 A more complex example such as

y = AC + BC + ABC
could be drawn as two 2-input AND gates and one 3-input
AND gate feeding into a 3-input OR gate. Two of the
AND gates have inverted inputs.
Ronald Tocci/Neal Widmer/Gregory
Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
3-9 NOR Gates and NAND Gates
 Combine basic AND, OR, and NOT
operations.
 The NOR gate is an inverted OR gate. An
inversion “bubble” is placed at the output
of the OR gate.
 The Boolean expression is, x = A + B

Ronald Tocci/Neal Widmer/Gregory


Moss Copyright ©2007 by Pearson Education, Inc.
Digital Systems: Principles and Columbus, OH 43235
Applications, 10e All rights reserved..
Figure 3-19 (a) NOR symbol; (b) equivalent circuit; (c) truth table. Tocci 10th Edition
© 2007 Pearson Education, Inc.
Digital Systems: Principles and Applications, 10e Pearson Prentice Hall
By Ronald J. Tocci, Neal S. Widmer, and Gregory L. Moss Upper Saddle River, NJ 07458

Das könnte Ihnen auch gefallen