UNIT2
UNIT2
UNIT-II
Combinational Circuits: Half and full Adder Subtractor, Decoders, Multiplexer, Demultiplexer
Sequential Circuits: Flip-Flops- CLK SR Flip- Flop, D Flip-Flop, J-K Flip Flop, T Flip-Flop.
Register: 4-bit shift register (SISO) Binary Counter- 4-bit synchronous and Asynchronous binary counter.
       Combinational circuit is a circuit in which we combine the different gates in the circuit, for example
       encoder, decoder, multiplexer and demultiplexer. 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
     BINARY ADDER:
    HALF ADDER
    FULL ADDER
                                                                                                                 1
COMPUTER ARCHITECTURE
 Sum is obtained through two input Ex-Or gate and Carry is obtained through two input AND gate.
                                                                                                     3
COMPUTER ARCHITECTURE
                        4
COMPUTER ARCHITECTURE
                                                        5
COMPUTER ARCHITECTURE
                        6
COMPUTER ARCHITECTURE
BINARY SUBTRACTOR:
   HALF SUBTRACTOR
   FULL SUBTRACTOR
HALF SUBTRACTOR
   The half subtractor is also a building block for subtracting two binary numbers. It has two inputs and
    two outputs. This circuit is used to subtract two single bit binary numbers A and B. The 'diff'
    and 'borrow' are two output states of the half subtractor.
  • A' and 'B' are the input variables whose values are going to be subtracted.
  • The 'Diff' and 'Borrow' are the variables whose values define the subtraction result, i.e., difference and
    borrow.
  • The first two rows and the last row, the difference is 1, but the 'Borrow' variable is 0.
  • The third row is different from the remaining one. When we subtract the bit 1 from the bit 0, the borrow
    bit is produced.
    FULL SUBTRACTOR
   A full subtractor is a combinational circuit that performs subtraction of two bits, one is minuend and
    other is subtrahend, taking into account borrow of the previous adjacent lower minuend bit. This
                                                                                                             7
COMPUTER ARCHITECTURE
    circuit has three inputs and two outputs. The three inputs A, B and Bin, denote the minuend,
    subtrahend, and previous borrow, respectively. The two outputs, D and Bout represent the difference
    and output borrow, respectively.
                                                                                                          8
COMPUTER ARCHITECTURE
                                       9
COMPUTER ARCHITECTURE
DECODERS
  •   A decoder is a combinational logic circuit that converts a N-bit binary code into M output lines such that
      only one output line is activated for each one of the possible combinations of inputs.
  •    In other words, we can say that a decoder identifies or recognizes or detects a particular code. § In its
      general form, a decoder has N input lines to handle N bits and form one to 2N output lines to indicate
      the presence of one or more N-bit combinations. Since each of N inputs can be a 0 or a 1, there are 2 N
      possible input combinations or codes.
  •    For each of these input combinations, only one of the M outputs will be active (HIGH), all other
      outputs will remain inactive (LOW). Some decoders are designed to produce active LOW output, while
      all other outputs remain HIGH.
  •   Some decoders do not utilize all of the 2N possible input codes. For example, a BCD to decimal decoder
      has a 4-bit input code and 10 output lines that correspond to the 10 BCD code groups 0000 through
      1001. Decoders of this type are often designed so that if any of the unused codes are applied to the input,
      none of the outputs will be activated.
  •    A binary decoder is usually implemented as either a stand-alone integrated circuit (IC) or as part of a
      more complex IC. Widely used decoders are often available in the form of standardized ICs.
2:4 DECODER
                                                                                                              10
COMPUTER ARCHITECTURE
  •   The truth table of a 2:4 decoder is shown below in which four input combinations 00, 10, 01 and 11 on
      the select lines produce the respective outputs. That means when S1=0 and S0 =0, the output at Y 0=0,
      similarly Y1=0 if the select inputs S1=0 and S0= 1 and so on.
      From the above truth table, we can write the output expressions as
  •   If S1=0 and S0=0, then Y0=0
  •   If S1= 0 and S0=1, then Y1=0
  •   If S1=1 and S0=0, then Y2=0
  •   If S1=1 and S0=1, then Y3=0
  •
              INPUTS                                      OUTPUTS
       EN               S1               S0               Y3      Y2                Y1           Y0
0 X X 1 1 1 1
1 0 0 1 1 1 0
1 0 1 1 1 0 1
1 1 0 1 0 1 1
1 1 1 0 1 1 1
                                                                                                          11
COMPUTER ARCHITECTURE
3:8 DECODER
INPUTS OUTPUTS
EN S2 S1 S0 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
0 X X X 1 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1 1 1 1 0
1 0 0 1 1 1 1 1 1 1 0 1
1 0 1 0 1 1 1 1 1 0 1 1
1 0 1 1 1 1 1 1 0 1 1 1
1 1 0 0 1 1 1 0 1 1 1 1
1 1 0 1 1 1 0 1 1 1 1 1
1 1 1 0 1 0 1 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1
                                                                                                          12
COMPUTER ARCHITECTURE
  •   The truth table of a 3:8 Decoder is shown below in which eight input combinations 000,
      001,010,011,100,101,110 and 111 on the select lines produces Y0=0 …..then Y7=0 respectively.
  •   That means when S2=0,S1=0 and S0 =0, the output at Y0=0, similarly Y1=0 if the select inputs S2=0,
      S1=0 and S0=1 and so on.
      From the truth table, we can write the output expressions as
  •   If S2=0, S1=0 and S0=0, then Y0=0
  •   If S2=0,S1= 0 and S0=1, then Y1=0
  •   If S2=0 ,S1=1 and S0=0, then Y2=0
  •   If S2=0 ,S1=1 and S0=1, then Y3=0
  •   If S2=1, S1=0 and S0=0, then Y4=0
  •   If S2=1,S1= 0 and S0=1, then Y5=0
  •   If S2=1 ,S1=1 and S0=0, then Y6=0
  •   If S2=1 ,S1=1 and S0=1, then Y7=0
                                                                                                           13
COMPUTER ARCHITECTURE
MULTIPLEXER
       Multiplexer means transmitting a large number of information units over a smaller number of channels
      or lines. A digital multiplexer is a combinational circuit that selects binary information from one of
      many input lines and directs it to a single output line. The selection of a particular input line is
      controlled by a set of selection lines. Normally there are 2 n input lines and n selection lines whose bit
      combination determine which input is selected.
      A multiplexer is also called as a Data Selector as it selects one of the inputs and passes it in the output
      based on the values of select input sequence.
2:1 MULTIPLEXER
  •   A 2:1 multiplexer consists two data input lines as I 0 and I1 , only one select lines as S0 and a single
      output line Y. The select lines S0 select one of the two input lines to connect the output line. The
      particular input combination on select lines selects one of input (I 0 and I1 ) to the output.
  •   The figure below shows the block diagram of a 2:1 multiplexer in which the multiplexer decodes the
      input through select line.
                                                                                                                 14
COMPUTER ARCHITECTURE
  •   The truth table of a 2:1 multiplexer is shown below in which two input combinations 0 and 1 on the
      select lines respectively switches the inputs I0 and I1 the output.
  •   That means when S0 =0, the output at Y is I0, similarly Y is I1 if the select inputs S0 =1 and so on.
INPUTS OUTPUT
                                          EN’         S0       Y
                                          1           X        0
                                          0           0        I0
                                          0           1        I1
      From the above truth table, we can write the output expressions as
  •   If S0 =0, then Y = I0
  •   If S0 =1 then Y = I3
      WORKING:
  •   When select inputs are S0 =0, then the output Y = I0
  •   When select inputs are S0 =1 , then the output Y = I1
      4:1 MULTIPLEXER
  •   A 4:1 multiplexer consists four data input lines as I 0 ,I1 ,I2 and I3, two select lines as S0 and S1 and a
      single output line Y. The select lines S0 and S1 select one of the four input lines to connect the output
      line. The particular input combination on select lines selects one of input (I 0 ,I1 ,I2 and I3) to the output.
  •   The figure below shows the block diagram of a 4:1 multiplexer in which the multiplexer decodes the
      input through select line.
  •   The truth table of a 4:1 multiplexer is shown below in which four input combinations 00, 10, 01 and 11
      on the select lines respectively switches the inputs I0 ,I1 ,I2 and I3 to the output. That means when S0 =0
      and S1 =0 , the output at Y is I0, similarly Y is I1 if the select inputs S0 =0 and S1 =1 and so on.
                                                                                                                    15
COMPUTER ARCHITECTURE
INPUTS OUTPUT
                               EN’      S1         S0          Y
                               1        X          X           0
                               0        0          0           I0
                               0        0          1           I1
                               0        1          0           I2
                               0        1          1           I3
      From the above truth table, we can write the output expressions as
  •   If S0 =0 and S1 =0 , then Y = I0
  •   If S0 =0 and S1 =1 , then Y = I1
  •   If S0 =1 and S1 =0 , then Y = I2
  •   If S0 =1 and S1 =1 , then Y = I3
  •   From the expressions of the truth table, a 4:1 multiplexer can be implemented by using basic logic gates.
      The below figure shows the logic circuit of 4:1 MUX:
      WORKING:
  •   When S0 =0 and S1 =0 , then Y = I0
  •   When S0 =0 and S1 =1 , then Y = I1
  •   When S0 =1 and S1 =0 , then Y = I2
  •   When S0 =1 and S1 =1 , then Y = I3
                                                                                                             16
COMPUTER ARCHITECTURE
      8:1 MULTIPLEXER
  •   An 8:1 multiplexer consists eight data input lines as I 0 ,I1 ,I2, I3 ,I4 ,I5,I6 and I7;three select lines as S0 S1
      and S2 and a single output line Y. The select lines S0 S1 and S2 select one of the eight input lines to
      connect the output line. The particular input combination on select lines selects one of input (I 0 ,I1 ,I2, I3
      ,I4 ,I5,I6 and I7) to the output.
  •   The figure below shows the block diagram of a 8:1 multiplexer in which the multiplexer decodes the
      input through select line.
  •   The truth table of a 8:1 multiplexer is shown below in which eight input combinations 000,
      001,010,011,100,101,110 and 111 on the select lines respectively switches the inputs I 0 ,I1 ,I2, I3 ,I4 ,I5,I6
      and I7 to the output. That means when S0 =0,S1 =0 and S2 =0 the output at Y is I0, similarly Y is I1 if the
      select inputs S0 =0,S1 =0 and S2 =1 and so on.
      From the truth table, we can write the output expressions as
  •   If S2 =0,S1 =0 and S0 =0 , then Y = I0
  •   If S2 =0,S1 =0 and S0 =1, then Y = I1
  •   If S2 =0,S1 =1 and S0 =0, then Y = I2
  •   If S2 =0,S1 =1 and S0 =1 , then Y = I3
  •   If S2 =1,S1 =0 and S0 =0 , then Y = I4
  •   If S2 =1,S1 =0 and S0 =1 , then Y = I5
  •   If S2 =1,S1 =1 and S0 =0 , then Y = I6
  •   If S2 =1,S1 =1 and S0 =1 , then Y = I7
                                                   INPUTS         OUTPUT
                                         EN’     S2 S1 S0        Y
                                         1       X X X           0
                                         0       0 0 0           I0
                                         0       0 0 1           I1
                                         0       0 1 0           I2
                                         0       0 1 1           I3
                                         0       1 0 0           I4
                                         0       1 0 1           I5
                                         0       1 1 0           I6
                                         0       1 1 1           I7
  •   From the expressions of the truth table, a 8:1 multiplexer can be implemented by using basic logic gates.
                               The below figure shows the logic circuit of 8:1 MUX:
                                                                                                                        17
COMPUTER ARCHITECTURE
      WORKING:
  •   when S2 =0,S1 =0 and S0 =0 , then Y = I0
  •   when S2 =0,S1 =0 and S0 =1, then Y = I1
  •   when S2 =0,S1 =1 and S0 =0, then Y = I2
  •   when S2 =0,S1 =1 and S0 =1 , then Y = I3
  •   when S2 =1,S1 =0 and S0 =0 , then Y = I4
  •   when S2 =1,S1 =0 and S0 =1 , then Y = I5
  •   when S2 =1,S1 =1 and S0 =0 , then Y = I6
  •   when S2 =1,S1 =1 and S0 =1 , then Y = I7
      DEMULTIPLEXER
      A demultiplexer (or demux) is a device that takes a single input line and routes it to one of several digital
      output lines. A demultiplexer of 2n outputs has n select lines, which are used to select which output line
      to send the input. A demultiplexer is also called a data distributor.
                                                                                                                18
COMPUTER ARCHITECTURE
1:4 DEMULTIPLEXER
0 1 Y1
1 0 Y2
1 1 Y3
              From the above truth table, I is available in complement form at Y 0 ,Y1 ,Y2 and Y3 ,we can write
              the output expressions as
  •   If S1 =0 and S0 =0 , then Y = Y0 (in complement form)
  •   If S1 =0 and S0 =1 , then Y = Y1(in complement form)
  •   If S1 =1 and S0 =0 , then Y = Y2(in complement form)
  •   If S1 =1 and S0 =1 , then Y = Y3(in complement form)
                                                                                                              19
COMPUTER ARCHITECTURE
1:8 DEMULTIPLEXER
  •   The 1:8 Demultiplexer consists of 1 input signal, 3 select signals and 8 output signals. The number of the
      output signal is always decided by the number of the control signal and vice versa.
  •   There are 3 NOT gates through which select inputs are passed, and 8 NAND gates, which decides or
      control the output. The combination of the input signal along with control signals will decide that the
      output through which input signal will pass through.
  •   The truth table of a 1:8 demultiplexer is shown below in which eight input combinations
      000,001,010,011,100,101,110 and 111 on the select lines switches the input I at the terminals Y 0 ,Y1 ,Y2
      ,Y3 , Y4 , Y5 , Y6 and Y7 output in complement form. That means when S2 =0 ,S1 =0 and S0 =0 , the
      output at Y0 in complement form of I , similarly output is Y1 if the select inputs S2 =0 ,S1 =0 and S0
      =1 and so on.
                                                                                                             20
COMPUTER ARCHITECTURE
                                                                                                         21
COMPUTER ARCHITECTURE
Sequential Circuits: Flip-Flops- CLK SR Flip- Flop, D Flip-Flop, J-K Flip Flop, T Flip-Flop.
Flip Flops
       Flip flops are an application of logic gates. With the help of Boolean logic you can create memory with
       them.
       When a certain input value is given to them, they will be remembered and executed, if the logic gates
       are designed correctly.
       There are mainly four types of flip flops that are used in electronic circuits. They are
      The basic Flip Flop or S-R Flip Flop
      D Flip Flop [Delay Flip Flop]
      J-K Flip Flop
      T Flip Flop[Toggle Flip Flop]
      MS JK FF
                                                                                                             22
COMPUTER ARCHITECTURE
       The two NAND gates apply the control signal S & R during time intervals when the enable signal CP is
       logic 1.
       When CP is logic 0, the inputs are held in the S=R=0 state. So the operation of the latch is as follows-
       When CP=0, no change occurs. As soon as a pulse is given the value of CP turns ‘1’.
      This makes the values at S & R to pass through the flip-flop. But when the values of both S & R values
       turn ‘1’, the high value of CP causes both of them to turn to ‘0’ for a short moment.
      As soon as the pulse is removed, the flip-flop state becomes intermediate.
      Thus, either of the two states may be caused & it depends on whether the set or reset i/p of flip-flop
       remains ‘1’ longer than the transition to ‘0’ at the end of the pulse.
      Thus the invalid states can be eliminated.
                                                                                                             23
COMPUTER ARCHITECTURE
D Flip-flop:
                                                                                                             24
COMPUTER ARCHITECTURE
       Both the S and the R inputs of the previous SR bistable have now been replaced by two inputs called the
       J and K inputs, respectively after its inventor Jack Kilby. Then this equates to: S=J.Q’ and R=K.Q
       The two 2-input AND gates of the gated SR bistable have now been replaced by two 3-input NAND
       gates with the third input of each gate connected to the outputs at Q and Q’. This cross coupling of the
       flip-flop allows the previously invalid condition of S = “1” and R = “1” state to be used to produce a
       “toggle action” as the two inputs are now interlock(join).
                                                                                                                 25
COMPUTER ARCHITECTURE
        JK flip-flop is basically an SR flip flop with feedback which enables only one of its two input terminals,
        either SET or RESET to be active at any one time thereby eliminating the invalid condition seen
        previously in the SR flip flop circuit. Also when both the J and the K inputs are at logic level “1” at the
        same time, and the clock input is pulsed either “HIGH”, the circuit will “toggle” from its SET state to a
        RESET state, or visa-versa.
        JK flip-flop has four states. They are shown in truth table. The description of each combination and
        corresponding result is given below:
1) J=0, K=0—>Q & Q’ = Remember[previous value]
        If both the values of J &K are switched to 0, then the circuit remembers the value of J&K in their
        previous state. So there is no change in the output Q.
2)J=0, K=1—>Q=0, Q’=1 [RESET state]
        When J=0 and K=1 then output Q=0.This state is known as the RESET state.
3) J=1, K=0—>Q=1, Q’=0 [SET state]
        When J=1 and K=0 then output Q=1. This state is called the SET state.
4)J=1, K=1—>Q & Q’ TOGGLE
When J=1 and K=1 then output Q and Q’ toggles. This is an toggle state because the values of both Q and Q’
are complimented forms of their previous values.
                                                                                                                 26
COMPUTER ARCHITECTURE
T Flip Flop
       This is a simpler version of the J-K flip flop. Both the J and K inputs are connected together and thus are
       also called a single input J-K flip flop. When clock pulse is given to the flip flop, the output begins to
       toggle.
                                                                                                               27
COMPUTER ARCHITECTURE
Register: 4-bit shift register (SISO) Binary Counter- 4-bit synchronous and Asynchronous binary counter.
Shift Registers
   • Registers are used for storage and transfer of binary information in system.
   • The difference between a register and counter is that a register has no specified sequence states
   • They are used for purpose of storing and shifting binary data
   • They also used in operations such as complementation, multiplication and division, storing of binary bit
       done with a flip flop,
   • FF has two states 1 and 0 ,if the circuit is 0 state it continues to remain in this state as also if it is 1 ,this
       property is called memory.
   • An array of FFs suitable for storing a binary information is referred as register.
   • The storage capacity of register is the number of bits of digital data it can store.
A Serial-In Serial-Out shift register is a sequential logic circuit that allows data to be shifted in and out one bit
at a time in a serial manner. It consists of a cascade of flip-flops connected in series, forming a chain. The input
data is applied to the first flip-flop in the chain, and as the clock pulses, the data propagates through the flip-
flops, ultimately appearing at the output.
The logic circuit provided below demonstrates a serial-in serial-out (SISO) shift register. It comprises four D
flip-flops that are interconnected in a sequential manner. These flip-flops operate synchronously with one
another, as they all receive the same clock signal.
Each D flip-flop in the circuit has a Data (D) input, a Clock (CLK) input, and an output (Q). The D input represents
the data to be loaded into the flip-flop, while the CLK input is connected to the common clock signal. The output
(Q) of each flip-flop is connected to the D input of the next flip-flop, forming a cascade.
In a right-shift SISO shift register, data bits move towards the right with each clock pulse.
                                                                                                                     28
COMPUTER ARCHITECTURE
Shift registers wherein input enters from left side and numbers already present on it, effuse or excrete from right
side, are called shift right registers. In other words, registers which transfers or shifts input data rightwards, are
called shift right registers. In figure 7.2, a shift right register has been illustrated, which contains four flip-flops
(it means that this register can store only a 4 – bits binary number). According to this figure, every Q output
keeps on setting D input of every next flip-flop. When rising clock edge arrives, then stored bits shift rightward
according to the “one–bit position per clock pulse” principle. For example, D in value is 1 (i.e. Din = 1) and Q =
0000, then upon influx of the first positive clock edge (i.e. clock pulse), leftward flip-flop tends to set. In such a
                                                                                                                     29
COMPUTER ARCHITECTURE
situation, all data inputs except input on the left side, are 0s. Thus, as a result of flip-flop D3 being set, the word
stored within a register is as follows;
Q=1000
Q=1000
With the appearance of this word, values of D2 and D3 turn out 1 (i.e. D2 = D3 = 1s), because Q3 output tends to
set output D3 (see figure). Similarly, following results with the advent of second rising clock edge.
Q=0100
Similarly, following changes take place as a result of 3rd clock pulse and 4th clock pulse.
Q=0010
Q=0001
                                                                                                                     30
COMPUTER ARCHITECTURE
A left-shift SISO shift register works similarly but moves data bits from right to left.
A shift register, wherein input data is entered from the right side, whereas digits already present on the register
leave out/ remove from the left side, are called shift left registers. In other words, registers which shift input
data towards left, are called shift left registers.
In figure 7.5, a shift left register has been elucidated, which consists of four D type flip-flops. According to the
figure, Din sets the right most flip-flop, Q0 sets the second flip-flop, Q1 sets third flip-flop and Q2 sets fourth or
final flip-flop. Remember that every time this register receives next positive clock pulse its stored bits shift
leftwards as per one position / clock pulse principle. For example, if a state of D in = 1 and Q = 0000 exits on
register, in such a situation, the rightmost flip-flop (Q0) sets with the arrival of first clock pulse (or rising clock
edge), as a result values of all data inputs are 0, except 1 existing on the right end. In other words, stored word
in the register is as follows;
Q=0000
Q=0001
Similarly, as a result of third and fourth positive clock pulses, following changes take place in the register;
Q=0010
Q=0100
Q=1000
                                                                                                                32
COMPUTER ARCHITECTURE
COUNTERS
  •   Circuits for counting events are frequently used in computers and other digital systems. Since a
      counter circuit must remember its past states, it has to possess memory.
  •   FF can be connected to each other to perform counting operations, such combination of FF is called as
      counters.
  •   A single FF have its o/p one of two logic states 0 or 1 ,i.e. it can count one to two.
  •   Similarly 2 FF count 4 possible states and so on ,in general counter with n number of FF can count
      max. 1 to 2n
  •    A counters can be synchronous( they need clk pulse) or asynchronous(no need of clock pulse)
COUNTERS
                    ASYNCHRONOUS                SYNCHRONOUS
                      COUNTERS                    COUNTERS
  •   Counters can be classified into two broad categories according to the way they are clocked:
  •   Asynchronous (Ripple) Counters - the first flip-flop is clocked by the external clock pulse, and then each
      successive flip-flop is clocked by the Q or Q' output of the previous flip-flop.
  •   Synchronous Counters - all memory elements are simultaneously triggered by the same clock.
                                                                                                              33
COMPUTER ARCHITECTURE
                             CLOCK       Q3   Q2   Q1   Q0
                             PULSE
                             0           0    0    0    0
                             1           0    0    0    1
                             2           0    0    1    0
                             3           0    0    1    1
                             4           0    1    0    0
                             5           0    1    0    1
                             6           0    1    1    0
                             7           0    1    1    1
                             8           1    0    0    0
                             9           1    0    0    1
                             10          1    0    1    0
                             11          1    0    1    1
                             12          1    1    0    0
                             13          1    1    0    1
                             14          1    1    1    0
                             15          1    1    1    1
                                                             34
COMPUTER ARCHITECTURE
WORKING:
  • When clock 0 is applied, all the FFs are reset so the output Q3 Q2 Q1 Q0 =0 0 0. This is the initial position
    of the counter.
  • When clock 1 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 0 1
  • When clock 2 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 1 0
  • When clock 3 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 1 1
  • When clock 4 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 0 0
  • When clock 5 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 0 1
  • When clock 6 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 1 0
  • When clock 7 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 1 1
  • When clock 8 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 0 0
  • When clock 9 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 0 1
  • When clock 10 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 1 0
  • When clock 11 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 1 1
  • When clock 12 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 0 0
  • When clock 13 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 0 1
  • When clock 14 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 1 0
  • When clock 15 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 1 1
  • Thus we have implemented MOD 16 or 4-Bit Asynchronous Up counter which starts to count from
    the initial value ie 0000 and counts in forward manner till it reaches the final value of 1111.
                                                                                                                35
COMPUTER ARCHITECTURE
                            CLOCK          Q3   Q2   Q1   Q0
                            PULSE
                            0              1    1    1    1
                            1              1    1    1    0
                            2              1    1    0    1
                            3              1    1    0    0
                            4              1    0    1    1
                            5              1    0    1    0
                            6              1    0    0    1
                            7              1    0    0    0
                            8              0    1    1    1
                            9              0    1    1    0
                            10             0    1    0    1
                            11             0    1    0    0
                            12             0    0    1    1
                            13             0    0    1    0
                            14             0    0    0    1
                            15             0    0    0    0
                                                               36
COMPUTER ARCHITECTURE
A ripple counter is an asynchronous counter where only the first flip-flop is clocked by an external clock. All
subsequent flip-flops are clocked by the output of the preceding flip-flop. Asynchronous counters are also
called ripple-counters because of the way the clock pulse ripples it way through the flip-flops.
CONSTRUCTION:
    • To implement a 4-bit (MOD-16) Asynchronous Down Counter, 4 JK flip flops are used.
    • All the preset terminals of the flip flops are connected to PRE’ & All the clear terminals of the flip flops
        are connected to the CLR’.
    • The clock of 1Hz is provided to first flip flop .The o/p Q0’ of first ff is provided as clock to second ff.
        The o/p Q1’ of second ff is provided as clock to third ff. The o/p Q2’ of third ff is provided as clock to
        fourth ff. Q0 ,Q1, Q2 & Q3 are the required o/ps of the counter.
The initial state of the o/p of counter is denoted as 1111 during clock 0 and on providing the clock pulses , the
counter starts counting and generating the o/p from 1111 to 0000 as it is 4-bit Asynchronous Down Counter.
WORKING:
  • When clock 0 is applied, all the FFs are reset so the output Q3 Q2 Q1 Q0 =1111. This is the initial
    position of the counter.
  • When clock 1 is applied, we get the output as Q3 Q2 Q1 Q0 =1110
  • When clock 2 is applied, we get the output as Q3 Q2 Q1 Q0 =1101
  • When clock 3 is applied, we get the output as Q3 Q2 Q1 Q0 =1100
  • When clock 4 is applied, we get the output as Q3 Q2 Q1 Q0 =1011
  • When clock 5 is applied, we get the output as Q3 Q2 Q1 Q0 =1010
  • When clock 6 is applied, we get the output as Q3 Q2 Q1 Q0 =1001
  • When clock 7 is applied, we get the output as Q3 Q2 Q1 Q0 =1000
  • When clock 8 is applied, we get the output as Q3 Q2 Q1 Q0 =0111
  • When clock 9 is applied, we get the output as Q3 Q2 Q1 Q0 =0110
  • When clock 10 is applied, we get the output as Q3 Q2 Q1 Q0 =0101
  • When clock 11 is applied, we get the output as Q3 Q2 Q1 Q0 =0100
  • When clock 12 is applied, we get the output as Q3 Q2 Q1 Q0 =0011
  • When clock 13 is applied, we get the output as Q3 Q2 Q1 Q0 =0010
  • When clock 14 is applied, we get the output as Q3 Q2 Q1 Q0 =0001
  • When clock 15 is applied, we get the output as Q3 Q2 Q1 Q0 =0000
  • Thus we have implemented MOD 16 or 4-Bit Asynchronous Down counter which starts to count
    from the initial value ie 1111 and counts in backward or reverse manner till it reaches the final
    value of 0000.
                                                                                                                37
COMPUTER ARCHITECTURE
SYNCHRONOUS COUNTERS
  • Synchronous Counters are so called because the clock input of all the individual flip-flops within the
    counter are all clocked together at the same time by the same clock signal.
  • In Synchronous Counter, the external clock signal is connected to the clock input of EVERY
    individual flip-flop within the Counter so that all of the flip-flops are clocked together simultaneously
    (in parallel) at the same time giving a fixed time relationship. i.e. changes in the output occur in
    “synchronization” with the clock signal.
  • The result of this synchronization is that all the individual output bits changing state at exactly the same
    time in response to the common clock signal with no ripple effect and therefore, no propagation delay.
CLOCK PULSE Q3 Q2 Q1 Q0
                                  0                      0     0     0     0
                                  1                      0     0     0     1
                                  2                      0     0     1     0
                                  3                      0     0     1     1
                                  4                      0     1     0     0
                                  5                      0     1     0     1
                                  6                      0     1     1     0
                                  7                      0     1     1     1
                                  8                      1     0     0     0
                                  9                      1     0     0     1
                                  10                     1     0     1     0
                                  11                     1     0     1     1
                                  12                     1     1     0     0
                                  13                     1     1     0     1
                                  14                     1     1     1     0
                                  15                     1     1     1     1
                                                                                                              38
COMPUTER ARCHITECTURE
   •   It can be seen above, that the external clock pulses (pulses to be counted) are fed directly to each of
       the J-K flip-flops in the counter chain and that both the J and K inputs are all tied together in toggle
       mode, but only in the first flip-flop, flip-flop FFA (LSB) are they connected HIGH, logic “1” allowing
       the flip-flop to toggle on every clock pulse. Then the synchronous counter follows a predetermined
       sequence of states in response to the common clock signal, advancing one state for each pulse.
   •   The J and K inputs of flip-flop FFB are connected directly to the output QA of flip-flop FFA, but
       the J and K inputs of flip-flops FFC and FFD are driven from separate AND gates which are also
       supplied with signals from the input and output of the previous stage. These additional AND gates
       generate the required logic for the JK inputs of the next stage.
   •   If we enable each JK flip-flop to toggle based on whether or not all preceding flip-flop outputs (Q) are
       “HIGH” we can obtain the same counting sequence as with the asynchronous circuit but without the
       ripple effect, since each flip-flop in this circuit will be clocked at exactly the same time.
   •   Then as there is no inherent propagation delay in synchronous counters, because all the counter stages
       are triggered in parallel at the same time, the maximum operating frequency of this type of frequency
       counter is much higher than that for a similar asynchronous counter circuit.
WORKING:
  • When clock 0 is applied, all the FFs are reset so the output Q3 Q2 Q1 Q0 =0 0 0. This is the initial
    position of the counter.
  • When clock 1 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 0 1
  • When clock 2 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 1 0
  • When clock 3 is applied, we get the output as Q3 Q2 Q1 Q0 =0 0 1 1
  • When clock 4 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 0 0
  • When clock 5 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 0 1
  • When clock 6 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 1 0
  • When clock 7 is applied, we get the output as Q3 Q2 Q1 Q0 =0 1 1 1
  • When clock 8 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 0 0
  • When clock 9 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 0 1
  • When clock 10 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 1 0
  • When clock 11 is applied, we get the output as Q3 Q2 Q1 Q0 =1 0 1 1
  • When clock 12 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 0 0
  • When clock 13 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 0 1
  • When clock 14 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 1 0
  • When clock 15 is applied, we get the output as Q3 Q2 Q1 Q0 =1 1 1 1
  • Thus, we have implemented MOD 16 or 4-Bit synchronous Up counter which starts to count from
    the initial value ie 0000 and counts in forward manner till it reaches the final value of 1111.
                                                                                                                  39
COMPUTER ARCHITECTURE
CLOCK     Q3    Q2   Q1   Q0
PULSE
0         1     1    1    1
1         1     1    1    0
2         1     1    0    1
3         1     1    0    0
4         1     0    1    1
5         1     0    1    0
6         1     0    0    1
7         1     0    0    0
8         0     1    1    1
9         0     1    1    0
10        0     1    0    1
11        0     1    0    0
12        0     0    1    1
13        0     0    1    0
14        0     0    0    1
15        0     0    0    0
                                          40
COMPUTER ARCHITECTURE
   •   It can be seen above, that the external clock pulses (pulses to be counted) are fed directly to each of
       the J-K flip-flops in the counter chain and that both the J and K inputs are all tied together in toggle
       mode, but only in the first flip-flop, flip-flop FFA (LSB) are they connected HIGH, logic “1” allowing
       the flip-flop to toggle on every clock pulse. Then the synchronous counter follows a predetermined
       sequence of states in response to the common clock signal, advancing one state for each pulse.
   •   The J and K inputs of flip-flop FFB are connected directly to the output Q’A of flip-flop FFA, but
       the J and K inputs of flip-flops FFC and FFD are driven from separate AND gates which are also
       supplied with signals from the input and output of the previous stage. These additional AND gates
       generate the required logic for the JK inputs of the next stage.
   •   If we enable each JK flip-flop to toggle based on whether or not all preceding flip-flop outputs (Q’) are
       “HIGH” we can obtain the same counting sequence as with the asynchronous circuit but without the
       ripple effect, since each flip-flop in this circuit will be clocked at exactly the same time.
   •   Then as there is no inherent propagation delay in synchronous counters, because all the counter stages
       are triggered in parallel at the same time, the maximum operating frequency of this type of frequency
       counter is much higher than that for a similar asynchronous counter circuit.
WORKING:
  • When clock 0 is applied, all the FFs are reset so the output Q3 Q2 Q1 Q0 =1111. This is the initial
    position of the counter.
  • When clock 1 is applied, we get the output as Q3 Q2 Q1 Q0 =1110
  • When clock 2 is applied, we get the output as Q3 Q2 Q1 Q0 =1101
  • When clock 3 is applied, we get the output as Q3 Q2 Q1 Q0 =1100
  • When clock 4 is applied, we get the output as Q3 Q2 Q1 Q0 =1011
  • When clock 5 is applied, we get the output as Q3 Q2 Q1 Q0 =1010
  • When clock 6 is applied, we get the output as Q3 Q2 Q1 Q0 =1001
  • When clock 7 is applied, we get the output as Q3 Q2 Q1 Q0 =1000
  • When clock 8 is applied, we get the output as Q3 Q2 Q1 Q0 =0111
  • When clock 9 is applied, we get the output as Q3 Q2 Q1 Q0 =0110
  • When clock 10 is applied, we get the output as Q3 Q2 Q1 Q0 =0101
  • When clock 11 is applied, we get the output as Q3 Q2 Q1 Q0 =0100
  • When clock 12 is applied, we get the output as Q3 Q2 Q1 Q0 =0011
  • When clock 13 is applied, we get the output as Q3 Q2 Q1 Q0 =0010
  • When clock 14 is applied, we get the output as Q3 Q2 Q1 Q0 =0001
  • When clock 15 is applied, we get the output as Q3 Q2 Q1 Q0 =0000
  • Thus we have implemented MOD 16 or 4-Bit synchronous Down counter which starts to count
    from the initial value ie 1111 and counts in backward or reverse manner till it reaches the final
    value of 0000.
                                                                                                               41
COMPUTER ARCHITECTURE
APPLICATIONS OF COUNTERS
  1. Frequency divider
  2. Frequency measurement
  3. Clock generator
  4. Object counter
  5. Digital multimeters
  6. Digital clock
  7. Analog to digital converters
  8. Parallel to serial data conversion
  9. Count occurrences of any event
  10. Frequency division
  11. Generating timing sequence to control operations of digital system
  12. Ex: Digital clock use to keep time in hrs, mins and seconds
     More Reliable: Synchronous counters are more stable because everything happens at the same time,
      reducing the chance of errors.
    Better for High-Speed Applications: These counters can handle high-speed operations, making them
      suitable for things like fast timers or processing systems.
    Easier to Control: Since all flip-flops are controlled by one clock, it’s easier to manage the timing of
      the counter, especially in complex circuits.
Disadvantages of Synchronous Counter
    Complex Design: Synchronous counters are harder to design because they need extra components like a
      common clock and control circuits to make sure everything works together.
    Higher Power Consumption: Because all flip-flops change at the same time, it uses more power than
      counters where flip-flops change one at a time.
    Requires More Components: You need more parts (like clock drivers and buffers) to make sure
      everything stays synchronized, which makes the design more complicated and expensive.
 In synchronous counter we use a universal     In asynchronous counter main clock is only applied to
 clock that is common to all flip flops        the first flip flop and then for rest of flip flops the
 through out the circuit.                      output of previous flip flop is taken as a clock.
 Synchronous Counter will operate in any       Asynchronous Counter will operate only in fixed count
 desired count sequence.                       sequence (UP/DOWN).
 Synchronous Counter examples are: Ring        Asynchronous Counter examples are: Ripple UP
 counter, Johnson counter.                     counter, Ripple DOWN counter.
43