Modulo-4 Counter Lab Assignment in Computer Organization/Architecture, Lab Reports of Computer Architecture and Organization

A lab assignment for a computer organization/architecture course, focusing on designing a modulo-4 counter using flip-flops. The assignment includes building a 'silly circuit' with two flip-flops as a prerequisite, understanding the emulation tool, and creating a 'one hot' modulo-4 counter. The document also covers the placement and movement of routing points in the multi-media logic tool.

Typology: Lab Reports

Pre 2010

Uploaded on 08/04/2009

koofers-user-7rq
koofers-user-7rq 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPSC 2105 / CPSC 5155 Computer Organization/Architecture
Lab Assignment Modulo–4 Counter
The purpose of this lab is to use a circuit emulation tool to continue our investigation of
simple D flip–flops, to understand better how to use the emulation tool, and to design a
simple “one hot” modulo–4 counter. We begin with a simpler design with two flip–flops.
The Silly Circuit
We begin with a circuit that has two flip–flops and no apparent use. The purpose of this first
exercise is to hook up two D flip–flops in a circuit that demonstrates a few features. The two
flip–flops will be labeled FF1 and FF2. The design specifications are as follows:
FF1 this will be initialized to 1.
It will have input from a switch.
FF2 this will be initialized to 0.
It will have its input from the output of flip–flop 1.
Here is the basic idea for initializing the flip–flops. The circuit on the left shows a flip–flop
that is initialized to Q = 1; this is used for FF1. The circuit on the right shows a flip–flop that
is initialized to Q = 0; this is used for FF2.
RUN = 0 Flip–flop is preset to Q = 1 RUN = 0 Flip–flop is cleared to Q = 0.
The first step of this lab is to lay down the basic structure.
In this figure, we see the following features that will be used in the final circuit.
1. The signal RUN is attached to the
PRE
input of FF1 and the
CLR
input of FF2.
When RUN = 0, FF1 is set to 1 and FF2 is cleared.
2. The signal RUN is also an input to an AND gate used as a clock input to each of
FF1 and FF2. Each receives the clock signal only when RUN = 1.
pf3
pf4

Partial preview of the text

Download Modulo-4 Counter Lab Assignment in Computer Organization/Architecture and more Lab Reports Computer Architecture and Organization in PDF only on Docsity!

CPSC 2105 / CPSC 5155 Computer Organization/Architecture

Lab Assignment Modulo–4 Counter

The purpose of this lab is to use a circuit emulation tool to continue our investigation of simple D flip–flops, to understand better how to use the emulation tool, and to design a simple “one hot” modulo–4 counter. We begin with a simpler design with two flip–flops. The Silly Circuit We begin with a circuit that has two flip–flops and no apparent use. The purpose of this first exercise is to hook up two D flip–flops in a circuit that demonstrates a few features. The two flip–flops will be labeled FF1 and FF2. The design specifications are as follows: FF1 this will be initialized to 1. It will have input from a switch. FF2 this will be initialized to 0. It will have its input from the output of flip–flop 1. Here is the basic idea for initializing the flip–flops. The circuit on the left shows a flip–flop that is initialized to Q = 1; this is used for FF1. The circuit on the right shows a flip–flop that is initialized to Q = 0; this is used for FF2. RUN = 0 Flip–flop is preset to Q = 1 RUN = 0 Flip–flop is cleared to Q = 0. The first step of this lab is to lay down the basic structure. In this figure, we see the following features that will be used in the final circuit.

  1. The signal RUN is attached to the (^) PRE input of FF1 and the CLR input of FF2. When RUN = 0, FF1 is set to 1 and FF2 is cleared.
  2. The signal RUN is also an input to an AND gate used as a clock input to each of FF1 and FF2. Each receives the clock signal only when RUN = 1.

An Aside: Moving the Dots It has been my experience that placing and moving the routing points, also called “dots”, can be somewhat challenging. The method to use is certainly not obvious. The Multi–Media logic tool has rather primitive drawing algorithms. This may result in a signal line being drawn straight through an element that relates to another part of the circuit. In order to create an easily read drawing, one must use the routing points. This leads to the question of how one places and moves these dots. The routing points, which the tool calls “nodes”, can be placed with the Node Tool. Often, this placement is somewhat rough. The way to move the node to a more desirable location is to use the Selector Tool. With the Selector Tool active place the arrow slightly below the routing point and left–click the mouse. The routing point will be highlighted as above and the mouse can be used to relocate the node. Implementing the Silly Circuit In this part of the lab, build upon the circuit shown above. Here are the criteria

  1. Flip–flop FF1 is initialized at Q = 1, and flip–flop FF2 is initialized at Q = 0.
  2. The D input for FF1 is a switch and the D input for FF2 is the output of FF1.
  3. The frequency for the oscillator is set to something like 2 Hz. For this lab, the student should implement the circuit above. As already noted, this circuit is based upon the one shown first, which shows the connections for the initialization and input for the clock. The student should run this and observe the behavior. Modulo–4 Counters We now move to the modulo–4 counter, which is the main focus of this lab exercise. There are two simple ways to design a modulo–4 counter.
  4. The simplest way uses two flip–flops, which might be called FF1 and FF0. The circuit produces values of these two flip–flops in the sequence 00, 01, 10, 11, etc. These are input to a decoder, which produces the output.
  5. The “one hot” approach uses four flip–flops, which circulate a 1 bit. At any time only one flip–flop has the value 1, it is the “hot one”. There is no decoder needed.

With the three fragmentary circuits above in mind, we may now show the complete circuit. The student should implement this circuit and observe the following behavior.

  1. After some transient behavior at the start, the circuit initializes with the left LED lighted and the other three not illuminated.
  2. When the RUN switch is set to 1 and the oscillator frequency is set to some low value (such as 2 Hz), the LED’s light up one at a time. Compare the circuit above with the rough schematic of the Minor State Register for the Boz–5 computer. The two represent the same circuit.