You are on page 1of 18

Computer Architecture and Networks

Functional Units from Logic Gates


(Combinational Circuits)
Bijay Babu Regmi
stw0010@softwarica.edu.np
Functional Units from Logic Gates
Combinational Circuits
Combinational circuit is a circuit in which we combine the different gates in the circuit, for example encoder,
decoder, multiplexer, demultiplexer, etc.

Some of the characteristics of combinational circuits are following −


● The output of combinational circuit at any instant of time, depends only on the levels present at input
terminals.
● The combinational circuit do not use any memory. The previous state of input does not have any effect on the
present state of the circuit.
● A combinational circuit can have an n number of inputs and m number of outputs.
Decoder
A decoder is a combinational circuit. It has n input and to a maximum m = 2 n outputs. Decoder is identical to a
demultiplexer without any data input. It performs operations which are exactly opposite to those of an encoder.

Examples of Decoders are following.


● Code converters
● BCD to seven segment decoders
● Nixie tube decoders
● Relay actuator

Fig: 3 to 8 line Decoder


Encoder
Encoder is a combinational circuit which is designed to perform the inverse operation of the decoder. An encoder
has 2n number of input lines and m=n number of output lines. An encoder produces an m bit binary code
corresponding to the digital input number. The encoder accepts an n input digital word and converts it into an m bit
another digital word.

Examples of Encoders are following.


● Priority encoders
● Decimal to BCD encoder
● Octal to binary encoder
● Hexadecimal to binary encoder
Multiplexer
Multiplexer is a device that has multiple inputs and a single line output. The select lines determine which input
is connected to the output, and also to increase the amount of data that can be sent over a network within certain
time. It is also called a data selector.
Demultiplexer
De-Multiplexer is a combinational circuit that performs the reverse operation of Multiplexer. It has single input, ‘n’
selection lines and maximum of 2n outputs. The input will be connected to one of these outputs based on the values
of selection lines.
Since there are ‘n’ selection lines, there will be 2n possible combinations of zeros and ones. So, each combination
can select only one output. De-Multiplexer is also called as Demux.
Contd….
Comparator
Binary comparators, also called digital comparators or logic comparators, are combinational logic circuits that are
used for testing whether the value represented by one binary word is greater than, less than, or equal to the value
represented by another binary word. Two basic types of comparator can be used.

• Equality comparators.

• Magnitude comparators

Equality Comparators

An equality comparator, such as that illustrated in Fig 4.3.1 is the simplest multi-bit logic comparator, and can be
used for such circuits as electronic locks and security devices where a binary password consisting of multiple bits
is input to the comparator to be compared with another preset word.
Contd...
The circuit of the equality comparator consists of an exclusive NOR gate (XNOR) per pair of input bits. If the
two inputs are identical (both 1s or both 0s) an output of logic 1 is obtained.

The outputs of the XNOR gates are then combined in an AND gate, the output of which will be 1, only when all
the XNOR gates indicate matched inputs.
Contd...
Magnitude Comparators

The magnitude comparator can also be used to indicate equality, but has a further two outputs, one that is logic 1
when word A is greater than word B, and another that is logic 1 when word A is less than word B. Magnitude
comparators therefore form the basis of decision making in logic circuits. Any logical problem can be reduced to
one or more (sometimes many) yes/no decisions based on a pair of compared values.
Half Adder
● An adder is a digital circuit that performs addition of numbers.
● adds two binary digits called as augend and addend and produces two outputs as sum and carry.
● XOR gate is applied to both inputs to produce sum and AND gate is applied to both inputs to produce carry

Logic Diagram Truth Table


Full Adder
● Full Adder is the adder which adds three inputs and produces two outputs.
● The first two inputs are A and B and the third input is an input carry as C-IN.
● The output carry is designated as C-OUT and the normal output is designated as S which is SUM.

Block Diagram Truth Table Logic Diagram

Logical Expression: Sum = C-IN XOR (A XOR B) and C-Out = AB + C-IN (A EX – OR B)


Multi - bit Full Adder
● Once we have a one-bit full adder, we can build multi-bit adders by chaining the carry out of one full adder
into the carry in of the full adder for the next bit.
Selecting and Enabling the Logic Function using 2
control lines
Arithmetic/Logic Unit

You might also like