Try โ€‚โ€‰HackMD

Digital Design Lab 8

Registers & Counters

The Islamic University of Gaza
Engineering Faculty
Department of Computer Engineering
Author: Mohammed Nafiz ALMadhoun2021/12/06

Introduction

In this lab, we are going to talk about registers, then we will talk about counters, finally, we will have a state machine that we should implement the logic for it using a counter.

Registers

A Register is just a group of flip-flops, which are connected in a certain way depending on the register type.

n-bit register

A regular data register is just a group of flip-flops with one common clock (And control singles), so if we want to store n-bits of data, we will use an n-bit register, which contains n number of flip-flops.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

3-bit Register

Register with Parallel Load

The idea here is to modify the previous design, so we will have an extra signal load, the load will control if the register should store the data on the next clock or not.

We can simply design this register using a multiplexer.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Register With Parallel Load

Shift Register

The bits (or flip-flops) in the shift register is connected in a way that allows the bit data to move to the next bit, this operation is called shifting, you can shift the data to the right, or the left.

The idea here is that if we want to load the 8-bits in the shift register, we could use only one single data input, but we will need 8 clock pulses to load the data (which mean it's slower).

The shift registers are widely used especially in serial communication (e.g. like USB port!).

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

4-bits shift register

Notice that we have serial data input, and parallel data output

Counters

In this section, we will connect the flip-flops in a way to create a counter (which will just count!).

Ripple Counter

The idea here is to drive the bit clock using the previous bit data, as you know we will count in each bit like this 0 -> 1 -> 0, so as you notice, we will need the falling edge to increment the next bit.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Ripple Counter

So as you notice, each bit will be inverted in the next clock pulse, and the clock of the bit uses the next bit inverted output (Because we want the falling edge).

Synchronous counters

The problem with the previous design is that the clock of each flip-flop is different (which will lead to some problems later).
To create a synchronous counter (synchronous means all the flip-flops change data at the same time), we will add some combinational logic to drive the flip-flops.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Synchronous Counter

Lab Tasks

Task 1: Build a Traffic Light

You should build a traffic light which has 4 states (Red, Red & Orange, Green, Orange).

Design your state machine (which has no inputs!), and then design the output logic.

To make things easier for you, use the 74/161 counter, note you can use the reset input to reset the counter!

You should first design the state machine, then you should simulate it using Logisim, finally build it and test it.

Datasheets

tags: Digital Design Digital IUG Computer Engineering
End Of Lab 8