Advanced Logic Circuits Project

13
1 Project Description This is a 4-bit counter designed to allow setting of initial count values and could operate on any of the 4 modes (binary count up, binary count down, BCD/decade count up, and Gray code count up). It also has a reset to reset the count values. There are 7 switches in total, 3 of which are for the reset, and counter choices (S2 – msb, S1 – lsb) while 4 are for the load values (L4, L3, L2, L1 – L4, msb; L1, lsb). The counter choice are 00 for binary count up, 01 for binary count down, 11 for BCD/decade count up, and 10 for Gray code count up the output will then be displayed to 4 LEDs (A4, A3, A2, A1 - A4, msb; A1, lsb). Scope and Limitations SCOPE This project focuses on 4 types of counters involving 4 bit values. LIMITATIONS Load values must be set before the circuit starts and once the circuit starts to count, the load values are ignored. Values ranges from 0-15 for the other counters and 0-9 for decade counter.

description

4-bit PresettableMulti-function Counter

Transcript of Advanced Logic Circuits Project

Page 1: Advanced Logic Circuits Project

1

Project Description

This is a 4-bit counter designed to allow setting of initial count values and could operate

on any of the 4 modes (binary count up, binary count down, BCD/decade count up, and Gray

code count up). It also has a reset to reset the count values. There are 7 switches in total, 3 of

which are for the reset, and counter choices (S2 – msb, S1 – lsb) while 4 are for the load values

(L4, L3, L2, L1 – L4, msb; L1, lsb). The counter choice are 00 for binary count up, 01 for binary

count down, 11 for BCD/decade count up, and 10 for Gray code count up the output will then

be displayed to 4 LEDs (A4, A3, A2, A1 - A4, msb; A1, lsb).

Scope and Limitations

SCOPE

This project focuses on 4 types of counters involving 4 bit values.

LIMITATIONS

Load values must be set before the circuit starts and once the circuit starts to count, the

load values are ignored. Values ranges from 0-15 for the other counters and 0-9 for decade

counter.

Page 2: Advanced Logic Circuits Project

2

System Operation

I. HARDWARE REQUIREMENTS:

Resistors

Integrated Circuits(IC)

LED

Connecting Wires

Bread Board

Capacitors

Switches

II. SYSTEM FLOWCHART:

Load Input

Load Counter

Choice

Output (LED)

Process Counter

Choice

Page 3: Advanced Logic Circuits Project

3

III. ASM CHART

A <- L

R

A <- 0 S1

S2

A <- A + 1 A <- A + 1

EG <- 1

A <- A - 1 A <- A + 1

EBCD <- 1

EBCD

A <- 0

T0

T1

S2 T2 T2 T2 T3

1

0

0 1

0 1

0 1

1 0

Page 4: Advanced Logic Circuits Project

4

IV. STATE TABLE

State table for system controller

Symbol Present

State Inputs

Next

State Outputs

External

Output

D1 D2 R S2 S1 D1 D2 T0 T1 T2 T3 Eg Ebcd

T0 0 0 X x X 0 1 0 1 1 1 0 0

T1 0 1 1 X X 0 1 1 0 1 1 0 0

T1 0 1 0 0 0 1 0 1 0 1 1 0 0

T1 0 1 0 1 0 1 0 1 0 1 1 1 0

T1 0 1 0 0 1 1 1 1 0 1 1 0 0

T1 0 1 0 1 1 1 0 1 0 1 1 0 1

T2 1 0 X x X 0 1 1 1 0 1 0 0

T3 1 1 x X X 0 1 1 1 1 0 0 0

V. LOGIC FUNCTION

D F/f inputs for controller

GD1 = R’ D1’ D2’

GD2 = R + D2’ + D1 + S1S2’

Reset Checker (Enabled at BCD counter mode, Ebcd)

MR = Master Reset (74LS193)

MR = (A4 A3 + A4 A2) (S2 S1’) R

Gray Code Converter

A4, A3, A2, A1 – input to converter from counter

GA4, GA3, GA2, GA1 – output to LED

T4 = S2 S1 – from external input

GA4 = A4

GA3 = A3 ( T4’ + A4’ ) + A3’ T4A4

GA2 = A2 ( T4’ + A3’ ) + A2’ T4A3

GA1 = A1 ( T4’ + A2’ ) + A1’ T4A2

Page 5: Advanced Logic Circuits Project

5

Design Layouts

I. TOP LEVEL BLOCK DIAGRAM

II. MODULAR BLOCK DIAGRAM

4-bit Presettable Multi-function

Counter

S(2:1)

R

A(4:1)

Controller

S(2:1)

4 Bit UP / DOWN

Binary Counter

T0

T1

T2 T3

Reset

CLK(up) CLK(dn)

L(2:1)

Grey Code

Converter

A(2:1)

R

Eg

Clk

GA(2:1)

Page 6: Advanced Logic Circuits Project

6

III. CIRCUIT OR LOGIC DIAGRAMS

Page 7: Advanced Logic Circuits Project

7

Prototype

Page 8: Advanced Logic Circuits Project

8

Test Output

INPUTS OUTPUTS

Present State Next State

R S2 S1 A4 A3 A2 A1 A4 A3 A2 A1

1 x x x x x x 0 0 0 0

0 0 0 x x x x A <- A + 1

0 0 1 x x x x A <- A - 1

0 1 0 x x x x A <- A + 1

0 1 1 1 0 0 1 0 0 0 0

0 1 1 1 0 1 0 0 0 0 0

0 1 1 1 0 1 1 0 0 0 0

0 1 1 1 1 0 0 0 0 0 0

0 1 1 1 1 0 1 0 0 0 0

0 1 1 1 1 1 0 0 0 0 0

0 1 1 1 1 1 1 0 0 0 0

Page 9: Advanced Logic Circuits Project

9

Bill of Materials

PROJECTED COST

Resistors Quantity Value Price

2 33000R 2 @ 2.25 = 4.50 8 1000R 8 @ 2.25 = 18.00 Capacitors Quantity Value Price 1 12µF 1 @ 2.00 = 2.00 1 10µF 1 @ 2.00 = 2.00 Integrated Circuits Quantity Value Price 1 74LS74 1 @ 28.00 = 28.00 2 74ALS11 2 @ 19.50 = 39.00 2 74LS04 2 @ 18.00 = 36.00 1 555 1 @ 18.00 = 18.00 2 74LS08 2 @ 20.00 = 40.00 3 74LS32 3 @ 20.00 = 60.00 1 74LS139 1 @ 22.00 = 22.00 1 74LS193 1 @ 38.00 = 38.00 Switches

Quantity Value Price 2 4P DIP SW. 2 @ 28.00 = 56.00 Breadboard

Quantity Value Price 3 Breadboard 3 @ 150.00 = 450.00 Wires

Quantity Value Price 3m Copper Wire 3 @ 4.50 = 13.50 Total Price = 827.00

Page 10: Advanced Logic Circuits Project

10

ACTUAL COST

Resistors Quantity Value Price

2 33000R 2 @ 2.25 = 4.50 8 1000R 8 @ 2.25 = 18.00 Capacitors Quantity Value Price 1 12µF 1 @ 2.00 = 2.00 1 10µF 1 @ 2.00 = 2.00 Integrated Circuits Quantity Value Price 1 74LS74 1 @ 28.00 = 28.00 2 74ALS11 2 @ 19.50 = 39.00 2 74LS04 2 @ 18.00 = 36.00 1 555 1 @ 18.00 = 18.00 2 74LS08 2 @ 20.00 = 40.00 3 74LS32 3 @ 20.00 = 60.00 1 74LS139 1 @ 22.00 = 22.00 1 74LS193 1 @ 38.00 = 38.00 Switches

Quantity Value Price 2 4P DIP SW. 2 @ 28.00 = 56.00 Breadboard

Quantity Value Price 2 Breadboard 2 @ 150.00 = 300.00 Wires

Quantity Value Price 3m Copper Wire 3 @ 4.50 = 13.50 Total Price = 677.00

Page 11: Advanced Logic Circuits Project

11

Conclusion and Recommendations

CONCLUSION

4-bit presettable multi-function counter can be implemented by using only one IC which

has up and down counters with load enable and master reset. For the up counter, the IC’s built

in up counter will be used same goes for the down counter. The built in up counter is also used

for the grey code counter as well as the bcd counter but a grey code converter will be used to

display the output when in grey code mode. BCD counter on the other hand, resets the counter

whenever the current state is greater than 9.

RECOMMENDATION

Displaying the output through a 7-segment display will be easier to track the errors and

check the output. Implementing the circuit in a pcb layout will improve its appearance

significally. The circuit can be simplified for lesser ICs and lesser gates for easier implementation

using programmable ICs.

Page 12: Advanced Logic Circuits Project

12

Appendix

Name: Rule Lymen Lagumbay

Age: 19

Address: Lapu-Lapu City

Birthday: April 23, 1994

Major: Software Engineering

Name: Rodolfo V. Tuble

Age: 22

Address: Nasipit Talamban Cebu City

Birthday: June 3, 1991

Major: Software Engineering

Page 13: Advanced Logic Circuits Project

13

PIN CONFIGURATIONS

74LS139

74LS193