Vous êtes sur la page 1sur 34

Combinational Logic

Logic circuits for digital systems may be combinational or


sequential.
A combinational circuit consists of logic gates whose outputs at
any time are determined from only the present combination of
inputs.
A combinational circuit performs an operation that can be
specified logically by a set of Boolean functions.
In contrast, sequential circuits employ storage elements in
addition to logic gates. Their outputs are a function of the
inputs and the state of the storage elements.
CS1026

For n input variables, there are 2^n


possible combinations of the binary
inputs. For each possible input
combination, there is one possible
value for each output variable. Thus, a
combinational circuit can be specified
with a truth table that lists the output values for each combination of input variables.
A combinational circuit also can be described by m Boolean functions, one for each
output variable. Each output function is expressed in terms of the n input variables.

CS1026

There are several combinational circuits that are employed


extensively in the design of digital systems.
These circuits are available in integrated circuits and are
classified as standard components. They perform specific digital
functions commonly needed in the design of digital systems.
The most important standard combinational circuits
are adders, subtractors, comparators, decoders, encoders,
and multiplexers.
These components are available in integrated circuits as
medium-scale integration (MSI) circuits.
CS1026

A N A LY S I S P R O C E D U R E

The analysis of a combinational circuit requires that we


determine the function that the circuit implements.
This task starts with a given logic diagram and culminates with
a set of Boolean functions, a truth table, or, possibly, an
explanation of the circuit operation.

CS1026

A N A LY S I S P R O C E D U R E

1. Label all gate outputs that are a function of input variables


with arbitrary symbolsbut with meaningful names.
Determine the Boolean functions for each gate output.
2. Label the gates that are a function of input variables and
previously labeled gates with other arbitrary symbols.
Find the Boolean functions for these gates.
3. Repeat the process outlined in step 2 until the outputs of the
circuit are obtained.
4. By repeated substitution of previously defined functions, obtain
the output Boolean functions in terms of input variables.
CS1026

CS1026

The derivation of the truth table for a circuit is a straightforward


process once the output Boolean functions are known
1. Determine the number of input variables in the circuit. For n
inputs, form the 2^n possible input combinations and list the binary
numbers from 0 to (2^n - 1) in a table.
2. Label the outputs of selected gates with arbitrary symbols.
3. Obtain the truth table for the outputs of those gates which are
a function of the input variables only.
4. Proceed to obtain the truth table for the outputs of those gates
which are a function of previously defined values until the columns
for all outputs are determined.
CS1026

000

CS1026

CS1026

DESIGN PROCEDURE

1. From the specifications of the circuit, determine the required


number of inputs and outputs and assign a symbol to each.
2. Derive the truth table that defines the required relationship
between inputs and outputs.
3. Obtain the simplified Boolean functions for each output as a
function of the input variables.
4. Draw the logic diagram and verify the correctness of the
design (manually or by simulation).
CS1026

10

A binary code represents numbers, text, computer processor instructions,


images etc using the binary number system's two binary digits, 0 and 1.

Weighted codes: In weighted codes, each digit is assigned a specific


weight according to its position. For example, in 8421BCD code, 1001
the weights of 1, 0, 0, 1 (from left to right) are 8, 4, 2 and 1 respectively.
Non-weighted codes: The non-weighted codes are not positionally
weighted. In other words, each digit position within the number is not
assigned a fixed value ( or weight ).
Excess-3 and gray code are non-weighted codes.
CS1026

11

Reflective codes: A code is reflective when the code is self


complementing. In other words, when the code for 9 is the complement
the code for 0, 8 for 1, 7 for 2, 6 for 3 and 5 for 4.
2421BCD, 5421BCD and Excess-3 code are reflective codes.
Sequential codes: In sequential codes, each succeeding 'code is one
binary number greater than its preceding code. This property helps in
manipulation of data.
8421 BCD and Excess-3 are sequential codes.
CS1026

12

Alphanumeric codes: Codes used to represent numbers, alphabetic


characters, symbols and various instructions necessary for conveying
intelligible information.
ASCII, EBCDIC, UNICODE are the most-commonly used
alphanumeric codes.
Error defecting and correcting codes: Codes which allow error
defection and correction are called error detecting and' correcting codes.
Hamming code is the mostly commonly used error detecting and
correcting code.
CS1026

13

CODEC

The word codec is a portmanteau of "coder-decoder" is a device or


computer program capable of encoding or decoding a digital data
stream or signal.

CS1026

14

Code Conversion Example

The availability of a large variety of codes for the same discrete


elements of information results in the use of different codes by
different digital systems. It is sometimes necessary
to use the output of one system as the input to another
To convert from binary code A to binary code B, the input lines
must supply the bit combination of elements as specified by
code A and the output lines must generate the corresponding
bit combination of code B.
A combinational circuit performs this transformation by means of
logic gates.
CS1026

15

Binary-coded decimal

In computing and electronic systems,


binary-coded decimal, BCD is
a class of binary encodings of
decimal numbers where each decimal
digit is represented by a fixed number
of bits, usually four (8421 code) or eight,
although other sizes (such as six bits)
have been used historically.

CS1026

16

BCD's main virtue is a more accurate representation and rounding of


decimal quantities as well as an ease of conversion into human-readable
representations.
As compared to binary positional systems, BCD's principal drawbacks
are a small increase in the complexity of the circuits needed to
implement basic arithmetics and a slightly less dense storage.
BCD was used in many early decimal computers. Although BCD is
not as widely used as in the past, decimal fixed-point and
floating-point formats are still important and continue to be used in
financial, commercial, and industrial computing, where subtle
conversion and rounding errors that are inherent to floating point
binary representations cannot be tolerated.

CS1026

17

BCD is very common in


electronic systems where a
numeric value is to
be displayed, especially in
systems consisting solely of
digital logic, and not containing
a microprocessor.

CS1026

18

Many non-integral values, such as decimal 0.2, have an infinite


place-value representation in binary (.001100110011...) but have a finite
place-value in binary-coded decimal (0.0010).
Consequently a system based on binary-coded decimal representations of
decimal fractions avoids errors representing and calculating such values.
Scaling by a factor of 10 (or a power of 10) is simple; this is useful when
a decimal scaling factor is needed to represent a non-integer quantity
(e.g., in financial calculations)
Rounding at a decimal digit boundary is simpler.
Addition and subtraction in decimal does not require rounding.
Alignment of two decimal numbers (for example 1.3 + 27.08) is a simple,
exact, shift.
CS1026

19

By utilizing BCD, the manipulation of numerical data for display can be


greatly simplified by treating each digit as a separate single sub-circuit.
This matches much more closely the physical reality of display
hardwarea designer might choose to use a series of separate identical
seven-segment displays to build a metering circuit, for example.
If the numeric quantity were stored and manipulated as pure binary,
interfacing to such a display would require complex circuitry.
Therefore, in cases where the calculations are relatively simple working
throughout with BCD can lead to a simpler overall system than
converting to binary.
CS1026

20

Some operations are more complex to implement. Adders require extra


logic.
1520 percent more circuitry is needed for BCD add compared to pure
binary.
Multiplication requires the use of algorithms that are somewhat more
complex than shift-mask-add (a binary multiplication, requiring binary
shifts and adds or the equivalent, per-digit or group of digits is required)
Standard BCD requires four bits per digit, roughly 20 percent more space
than a binary encoding.
When packed so that three digits are encoded in ten bits, the storage
overhead is greatly reduced, at the expense of an encoding that is
unaligned with the 8-bit byte boundaries common on existing hardware,
resulting in slower implementations on these systems.
CS1026

21

Excess-3
George Robert Stibitz is internationally
recognized as one of the fathers of the
modern first digital computer. He was a
Bell Labs researcher known for his work
in the 1930s and 1940s on the realization
of Boolean logic digital circuits using
electromechanical relays as the switching
element.
Excess-3 binary-coded decimal (XS-3)
or Stibitz code, also called biased
representation or Excess-N, is a
complementary BCD code and numeral system.
CS1026

22

Excess-3

Excess-3 was used on some older computers as well as in cash registers


and hand held portable electronic calculators of the 1970's, among
other uses.
CS1026

23

Excess-3

To encode a number such as 127, then, one simply encodes each of the
decimal digits as above, giving (0100, 0101, 1010).
The primary advantage of XS-3 coding over non-biased coding is that
a decimal number can be nines' complemented (for subtraction) as easily
as a binary number can be ones' complemented; just invert all bits.
In addition, when the sum of two XS-3 digits is greater than 9, the carry
bit of a four bit adder will be set high.

CS1026

24

The key feature of the excess-3 code is that it is self-complementing.


This means that the 1's complement of an excess-3 number is the
excess-3 code for the 9's complement of the corresponding decimal
number.
The 9's complement of a decimal number is found by subtracting each
digit in the number from 9. For example, the 9's complement of 4 is 5.
The excess-3 code for decimal 4 is 0111. The 1's complement of this is
1000, which is the excess-3 code for the decimal 5 (and 5 is the 9's
complement of 4).
The usefulness of the 9's complement and thus excess-3 stems from the
fact that subtraction of a smaller decimal number from a larger one can
be accomplished by adding the 9's complement (1's complement of the
excess-3 code) of the subtrahend (in this case the smaller number) to the
minuend and then adding the carry to the result. When subtracting a
larger number from a smaller one, there is no carry, and the result is in
9's complement form and negative.
This procedure has a distinct advantage over BCD in certain types of
arithmetic logic.
CS1026
25

CS1026

26

CS1026

27

CS1026

28

CS1026

29

Binary-coded decimal (BCD) is a


class of binary encodings of
decimal numbers where each
decimal digit is represented by a
fixed number of bits

Excess-3 equivalent of a decimal number is obtained by adding 3 and


then converting it to a binary format. For instance to find excess-3
representation of decimal number 4, first 3 is added to 4 to get 7
and then binary equivalent of 7 i.e. 0111 forms the excess-3
equivalent
CS1026

30

The six bit combinations not listed for the input variables are
dont care combinations.
These values have no meaning in BCD and we assume that they
will never occur in actual operation of the circuit.
Therefore, we are at liberty to assign to the output variables either
a 1 or a 0, whichever gives a simpler circuit

CS1026

31

A two-level logic diagram


for each output may be
obtained directly from the
Boolean expressions
derived from the maps.

CS1026

32

The expressions obtained above may be manipulated


algebraically for the purpose of using common gates
for two or more outputs.

Not counting input inverters, the implementation in sum-of-products


form requires seven AND gates and three OR gates. This implementation
requires four AND gates, four OR gates, and one inverter.
CS1026

33

CS1026

34

Vous aimerez peut-être aussi