Counters and Decoders

Transcription

1 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, , 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 (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 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 # Fall 1999

2 in computers where precise timing is important. There will be no problem in your experiment if you stay below 1 MHz. Fig Binary Counters. (a) Ripple-through. (b) Synchronous. In the synchronous counter in Fig (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 # Fall 1999

3 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 (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. You get a true result only for the number The output is zero for every other bit combination. Experiment # Fall 1999

4 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 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 # Fall 1999

6 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 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 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 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 # Fall 1999

7 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 # Fall 1999

If the T input is in 0 state (i.e., J = K = 0) prior to a clock pulse, the Q output will not change with the clock pulse. On the other hand, if the T input is in 1 state (i.e., J = K = 1) prior to a clock

DIGITAL COUNTERS http://www.tutorialspoint.com/computer_logical_organization/digital_counters.htm Copyright tutorialspoint.com Counter is a sequential circuit. A digital circuit which is used for a counting

SYNCHRONOUS COUNTERS Synchronous digital counters have a common clock signal that controls all flip-flop stages. Since a common clock controls all flip-flops simultaneously, there are no cumulative delays

DIGITAL COUNTER AND APPLICATIONS A digital counter is a device that generates binary numbers in a specified count sequence. The counter progresses through the specified sequence of numbers when triggered

Counters By: Electrical Engineering Department 1 Counters Upon completion of the chapter, students should be able to:.1 Understand the basic concepts of asynchronous counter and synchronous counters, and

SEQUENTIAL CIRCUITS http://www.tutorialspoint.com/computer_logical_organization/sequential_circuits.htm Copyright tutorialspoint.com The combinational circuit does not use any memory. Hence the previous

Today Sequential logic Latches Flip-flops Counters Time Until now: we have essentially ignored the issue of time We have assumed that our digital logic circuits perform their computations instantaneously

REGISTERS Sequential circuit used to store binary word Consists of a set of flip-flops (each flip-flop stores one bit of information) External gates may be used to control the inputs of the flip-flops:

Counters and State Machine Design November 25 Asynchronous Counters ENGI 25 ELEC 24 Asynchronous Counters The term Asynchronous refers to events that do not occur at the same time With respect to counter

Objectives Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop. describe how such a flip-flop can be SET and RESET. describe the disadvantage

Lecture 8: Synchronous Digital Systems The distinguishing feature of a synchronous digital system is that the circuit only changes in response to a system clock. For example, consider the edge triggered

E3: Digital electronics Goals: Basic understanding of logic circuits. Become familiar with the most common digital components and their use. Equipment: 1 st. LED bridge 1 st. 7-segment display. 2 st. IC

3.1 Bistable Element Let us look at the inverter. If you provide the inverter input with a 1, the inverter will output a 0. If you do not provide the inverter with an input (that is neither a 0 nor a 1),

Module 12 In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the current inputs. The following topics will be on sequential

Sequential Circuits Sequential circuits are those with memory, also called feedback. In this, they differ from combinational circuits, which have no memory. The stable output of a combinational circuit

LB no.. SYNCHONOUS COUNTES. Introduction Counters are sequential logic circuits that counts the pulses applied at their clock input. They usually have 4 bits, delivering at the outputs the corresponding

8.1 Objectives To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC. 8.2 Introduction Circuits for counting events are frequently used in computers and other digital

Latches and Flip-flops Latches and flip-flops are circuits with memory function. They are part of the computer's memory and processor s registers. SR latch is basically the computer memory cell Q=1 Q=0

Module-3 SEQUENTIAL LOGIC CIRCUITS Till now we studied the logic circuits whose outputs at any instant of time depend only on the input signals present at that time are known as combinational circuits.

CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach

Lecture-3 MEMORY: It is a storage device. It stores program data and the results. There are two kind of memories; semiconductor memories & magnetic memories. Semiconductor memories are faster, smaller,

Latches and Flip-flops Latches and flip-flops are circuits with memory function. They are part of the computer's memory and processor s registers. SR latch is basically the computer memory cell Q=1 Q=0

Combinational and Sequential Circuits. Basically, sequential circuits have memory and combinational circuits do not. Here is a basic depiction of a sequential circuit. All sequential circuits contain combinational

Chapter 4: One-Shots, Counters, and Clocks I. The Monostable Multivibrator (One-Shot) The timing pulse is one of the most common elements of laboratory electronics. Pulses can control logical sequences

Counters Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences. Two distinct types are in common usage:

1 Objective Lab 5 Fully Functional Stop Watch Build a fully functional stopwatch. 2 Introduction The overall goal of this lab is to build a fully functional stopwatch. This system will involve many smaller

Chapter 6 Registers and Counter The filp-flops are essential component in clocked sequential circuits. Circuits that include filp-flops are usually classified by the function they perform. Two such circuits

6 CHAPTER 6 DESIGN OF SEQUENTIAL LOGIC CIRCUITS IN QCA 6. INTRODUCTION The logic circuits whose outputs at any instant of time depend not only on the present inputs but also on the past outputs are known

Lesson 12 Sequential Circuits: Flip-Flops 1. Overview of a Synchronous Sequential Circuit We saw from last lesson that the level sensitive latches could cause instability in a sequential system. This instability

Mealy and Moore Type Finite State Machines Objectives There are two basic ways to design clocked sequential circuits. These are using: 1. Mealy Machine, which we have seen so far. 2. Moore Machine. The

ounter ounters ounters are a specific type of sequential circuit. Like registers, the state, or the flip-flop values themselves, serves as the output. The output value increases by one on each clock cycle.

Exercises, set 6. INTODUCTION TO HADWAE DEIGNING EUENTIAL CICUIT.. Lathes and flip-flops. In the same way that gates are basic building blocks of combinational (combinatorial) circuits, latches and flip-flops

ELET 3132L - Experiment #5 Bistable Latches and Flip-Flops Revised: October 2011 This exercise has two parts. The first part will be done in the MOSAIC computer lab. Students will perform simulations using

Chapter 11 Analog-Digital Conversion One of the common functions that are performed on signals is to convert the voltage into a digital representation. The converse function, digital-analog is also common.

Computer Science 220 Assembly Language & Comp. Architecture Siena College Fall 2011 opic Notes: Sequential Circuits We have seen many examples of what we can do with combinational logic taking a set of

To ensure the functioning of the site, we use cookies. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy &amp Terms.
Your consent to our cookies if you continue to use this website.