Counters and Decoders



Similar documents
Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Module 3: Floyd, Digital Fundamental

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Contents COUNTER. Unit III- Counters

Digital Logic Design Sequential circuits

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

Lecture 8: Synchronous Digital Systems

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Asynchronous Counters. Asynchronous Counters

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

The components. E3: Digital electronics. Goals:

ASYNCHRONOUS COUNTERS

Chapter 8. Sequential Circuits for Registers and Counters

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Theory of Logic Circuits. Laboratory manual. Exercise 3

Counters & Shift Registers Chapter 8 of R.P Jain

DEPARTMENT OF INFORMATION TECHNLOGY

BINARY CODED DECIMAL: B.C.D.

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

CHAPTER 11: Flip Flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Decimal Number (base 10) Binary Number (base 2)

1.1 The 7493 consists of 4 flip-flops with J-K inputs unconnected. In a TTL chip, unconnected inputs

Digital Logic Elements, Clock, and Memory Elements

Lecture-3 MEMORY: Development of Memory:

Counters are sequential circuits which "count" through a specific state sequence.

Counters. Present State Next State A B A B

CS311 Lecture: Sequential Circuits

Asynchronous counters, except for the first block, work independently from a system clock.

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Lesson 12 Sequential Circuits: Flip-Flops

Binary Adders: Half Adders and Full Adders

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Operating Manual Ver.1.1

CHAPTER 11 LATCHES AND FLIP-FLOPS

Digital Electronics Detailed Outline

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

CHAPTER 3 Boolean Algebra and Digital Logic

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Fig1-1 2-bit asynchronous counter

Flip-Flops, Registers, Counters, and a Simple Processor

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

Copyright Peter R. Rony All rights reserved.

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Memory Elements. Combinational logic cannot remember

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Cascaded Counters. Page 1 BYU

Sequential Logic Design Principles.Latches and Flip-Flops

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

(Refer Slide Time: 00:01:16 min)

Systems I: Computer Organization and Architecture

Wiki Lab Book. This week is practice for wiki usage during the project.

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Design: a mod-8 Counter

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Chapter 2 Logic Gates and Introduction to Computer Architecture

Upon completion of unit 1.1, students will be able to

7. Latches and Flip-Flops

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

A Digital Timer Implementation using 7 Segment Displays

Chapter 9 Latches, Flip-Flops, and Timers

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Fundamentals of Digital Electronics

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS


Sequential Logic: Clocks, Registers, etc.

Microprocessor & Assembly Language

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Combinational Logic Design Process

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Digital Controller for Pedestrian Crossing and Traffic Lights

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

3-Digit Counter and Display

COMBINATIONAL CIRCUITS

SN54/74LS192 SN54/74LS193

ECE380 Digital Logic

Lab 1: Study of Gates & Flip-flops

Registers & Counters

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

Lecture 7: Clocking of VLSI Systems

Chapter 5. Sequential Logic

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Transcription:

Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter might be used for counting the number of α-particles you observed in Experiment 8b. Reading 1. D&H, 11.1-11.5, 12.1-12.5. Counters Binary counters and binary numbers Theory A counter consists of a cascade of flip-flops connected so that the output of one flip-flop drives the input of the next. The signals to be counted are fed into the first flip-flop of the chain. The output, Q, of any given flip-flop represents a binary digit or bit (value 0 or 1). The complete set of outputs (...Q 2, ) gives the total number of pulses in binary arithmetic, hence the name Binary Counter. See Fig. 10.1 (a). The counters that we shall consider use JK flip-flops. Recall that the output of a JK changes only at the time of the negative edge of a pulse at the clock input. The new state into which it enters is determined by the values of J and K. In the simplest counter, every flip-flop is connected so that J = K = 1. For these values, the truth table for the JK says that: Q n +1 = Q n Thus the new state, Q n +1, triggered by the arrival of the n+1th clock pulse is always the complement i.e., the logical inverse, Q n, of the old state, Q n, which was generated by the previous pulse, etc.. This mode of operation is called Toggling. There are two main classes of counters: Asynchronous (also called Ripple-through, the kind you will build) and Synchronous counters. They are distinguished by the precision of timing of the output relative to the clock input. Examples of 3-bit counters of both types are shown in Fig. 10.1. The Ripple-through counter This counter is the type that you will build, since it has the fewest components. The input pulse train drives the clock input, C 0, of the first JK. The output,, of the first JK drives the clock input, C 1, of the second, causing the second to toggle at each negative going edge of. The process is repeated as you go down the chain. For each input pulse, the flip-flops toggle sequentially. The disadvantage of this type is that the 25 nsec. delays between the input and output of successive flip-flops are cumulative; the outputs get increasingly out of step with the input pulse as you go down the chain. This problem can become serious at high counting rates, say 10 MHz, or Experiment #10 10.1 Fall 1999

in computers where precise timing is important. There will be no problem in your experiment if you stay below 1 MHz. Fig. 10.1 Binary Counters. (a) Ripple-through. (b) Synchronous. In the synchronous counter in Fig. 10.1 (b), the problem is corrected by feeding the clock pulses simultaneously into every flip-flop. Whether or not this causes a change of state is determined by the J and K inputs used as dynamic controls. In the first flip-flop, J = K = 1 as before. In subsequent chips, J = K, but the logical value is determined by an AND gate. Thus, J 2 = Q 1, J 3 = Q 2 ( Q 1 ), and so on. The response of the jth flip-flop to the (n+1)th clock pulse can be represented by: ( Q j ) n +1 = ( Q j ) n [ Q 1 L Q j 1 ] n The jth flip-flop changes at the instant of the next clock pulse (plus a single delay of 25 nsec), if and only if every previous flip-flop in the chain is already in logical state Q=1. If one or more or the previous flip-flops is in logical 0, the state of the jth flip-flop remains the same. The overall effect is the same as in the ripple counter, but the delays do not accumulate. The input gate and resetting the counter to zero During a typical experiment, to measure the rate of radioactive decays for example, one carries out the following sequence of operations: 1. Reset all flip flops to zero. 2. open input gate to start counting. Experiment #10 10.2 Fall 1999

3. Count for a specified time. 4. Close input gate to stop counting. 5. Read total number of counts. 6. Repeat. The first flip-flop controls the flow of information into the counter. It can be employed as a gate by placing J 0 and K 0 under separate control. During normal counting, J 0 = K 0 = 1. To interrupt counting in order to read the total, we can set J 0 = K 0 = 0 for which the truth table says: No change with time. In order to reset the whole counter to zero after reading, we then set CLR = 0 for every flip flop. Decimal equivalents of binary numbers The total number of pulses is given in binary form by the set of the flip-flop outputs (...Q 2, ). Each Q represents a single bit with a value of 0 or 1. Looking at the waveforms in Fig. 10.1 (a), you see that changes for every input pulse changes only for every 2nd pulse, and so on. Thus for an m-bit counter, the decimal number of pulses is given by: ( ) = 2 j N = + 2Q 1 + 4Q 2 +L m j = 0 ( )Q j For each decimal number, N, there is a Boolean expression which represents the logical operations that you perform on the binary outputs to identify the decimal number. The truth table and Boolean expressions for some 3-bit numbers are shown in the diagram. In practice, you write a bar over the Q when the corresponding bit is 0 and leave out the bar when it is 1. The Boolean expression for a given decimal number gives zero for all combinations of bits that do not represent the number and give 1 for the correct combination. Consider for example, the binary number 1001 representing the decimal number, 9. Replace each binary 0 by a Q so that Q 3 Q 2 Q 1 = 1 0 0 1 = 1 1 1 1 = 1. You get a true result only for the number 1001. The output is zero for every other bit combination. Experiment #10 10.3 Fall 1999

Decade counters and the general Modulo-n counter The decade counter resets to zero by every 10th pulse. The output, known as binary coded decimal (BCD), is the same as a 4-bit binary scale up to decimal number 9. Beyond 9, the counter repeats, starting again from 0. The reset at 10 is so fast that you do not see it with a LED. The more general case is a Modulo-n counter, which resets to zero for every n-th pulse. A decade counter is the same as a Modulo-10 counter. We will illustrate how the conversion is done for a 3-bit Modulo-5 counter. You will work out the details for a 4-bit Decade counter. Fig. 10.2. Modulo-5 counter. (a) Circuit. (b) Truth table. Recall that during normal operation, the direct input of every flip-flop is held at CLR = 1. When CLR = 0, all outputs go to zero. The Modulo-5 counter is reset to zero by every 5th pulse using the CLR input. The 5th pulse is identified when the bit pattern satisfies the equation: Q 2 Q 1 = 1. However, the Q 1 is redundant, and the 5th pulse is uniquely identified in this counter by the expression Q 2 = 1. We set CLR = 0 by using a NAND gate to evaluate the expression. Experiment #10 10.4 Fall 1999

Decoders The circuit for the Modulo-5, 3-bit binary-to-decimal decoder is shown in Fig. 10.3. Since we have a 3-bit number, the decoding may be done in principle by a set of 3-input AND gates. Each gate identifies a particular decimal number in the range 0 to 4 according to the Boolean expressions in the truth table for 3-bit numbers. The decoder circuit on the left is shown only to illustrate the logic. It can be greatly simplified in the course of conversion to the required NAND and NOR gates. Here are some guidelines: Modulo 5 counter with decimal decoder Decimal output (LED) Q 2 Q 1 = 0 Q 2 Q 1 = 1 Q 2 Q 1 = 2 Q 2 Q 1 = 3 Q 2 Q 1 = 4 Simplified Circuit using 2-input NOR gates Simplification of Decoder Decimal Binary Boolean Q 2 Q 1 0 0 0 0 Q 2 Q 1 =Q 2 D=Q 2 +D Q2 Q 2 Q1 Q 1 Q0 1 0 0 1 Q 2 Q 1 =Q 1 Q0=Q 1 +Q0 2 0 1 0 Q 2 Q 1 =Q 1 Q0=Q 1 +Q0 3 0 1 1 Q 2 Q 1 =Q 1 Q0=Q 1 +Q0 4 1 0 0 Q 2 Q 1 =Q 2 D=Q 2 +D notes: D=Q1Q0 the block of Q2 s is redundant a) Refer to Experiment 9, page 9.6 for evaluation of 4-element products of the ABCD. b) Note that both the output, Q, and its complement are available from each flip-flop. Experiment #10 10.5 Fall 1999

c) Look for redundant bits. In the present case, Q 2 is redundant for decimals 1, 2, 3. Each of the combinations Q 1 ( =1) ( = 2),Q 1 ( = 3) appears only once in the list of numbers that a modulo-5 counter can generate before reset to zero at the 5th input pulse. The two bit combinations therefore identify uniquely the decimals 1, 2, and 3. d) Look for repeated combinations and evaluate them only once. Q 1 is repeated for decimals 0 and 4. We evaluate it once and call is D. e) The total number of chips on the board is often reduced by avoiding INVERTS. Unused gates on your NAND or NOR chips can be converted to INVERTS as shown in Exp. #9. Problems The methods for solving these problems are illustrated in the notes by the design of a 3-digit modulo-5 counter with decimal readout. 1. Draw the circuit for a 4-bit ripple-through binary counter using JK flip-flops. Arrange that the input can be gated by separate control of J and K for the first flip-flop; also that the entire counter can be reset to zero. Write down the truth table for the first 12 pulses and draw the waveforms that you would expect for C 0,, Q 2, and Q 3. Neglect the small delay introduced by each flip-flop. See Fig. 10.1. 2. Design the modifications you need to convert your binary counter to a decade counter. Write the truth table for the first 12 pulses and graph the expected waveforms. See Fig. 10.2. 3. Design a 4-bit BCD to decimal decoder whose inputs are provided by the outputs of your decade counter. Write down the truth table and the Boolean expression for each decimal output (0 thru 9). Simplify your circuit to use the smallest number of 2-input NOR and NAND gates. See Fig. 10.3 for a modulo-5 decoder. The Experiment 1. Design the circuits needed for the experiment. See the problems for details. Write down the circuits, truth tables, and predicted waveforms in you lab book before the class. Also a detailed wiring diagram for your circuit board is very helpful. Good organization is especially important with so many chips. 2. Construct a 4-bit ripple-through binary counter using JK flip-flops. Check that it functions correctly when driven by 250 µsec. pulses from your 555 clock at a rate of 1 khz. Observe the input pulses and the outputs, Q 2, and Q 3 with the oscilloscope. A stable display can only be obtained by triggering the scope from Q 3. Why? Draw the waveforms carefully and verify the truth table from your drawing. Check that the input gate and the zero reset function correctly. 3. Modify your circuit to make a decade counter. Check that the outputs now satisfy the truth table for BCD numbers using the same method as in part 2. Experiment #10 10.6 Fall 1999

4. Construct a 4-bit BCD to decimal decoder. Connect the inputs of your decoder to the appropriate flip-flop outputs of your counter. Display the ten decoder outputs (0 thru 9) on LED indicators. Verify that the system operates correctly by observing the LEDs when the input pulse rate is slow enough that you can see each one light up in turn. Experiment #10 10.7 Fall 1999