Digital 1 Final Project Sequential Digital System - Slot Machine

Similar documents
Introduction. Serial In - Serial Out Shift Registers (SISO)

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Asynchronous (Ripple) Counters

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

ASYNCHRONOUS COUNTER CIRCUITS

Catch or Die! Julia A. and Andrew C. ECE 150 Cooper Union Spring 2010

CSE 352 Laboratory Assignment 3

Report on 4-bit Counter design Report- 1, 2. Report on D- Flipflop. Course project for ECE533

Lecture 8: Sequential Logic

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

Counter dan Register

Contents Circuits... 1

ECB DIGITAL ELECTRONICS PROJECT BASED LEARNING PROJECT REPORT ON 7 SEGMENT DIGITAL STOP WATCH USING DECODER

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

We had to design a Led circuit that would contain multiple Leds, activate them by address, then holds the flashing addressed Led in memory and

Registers and Counters

Chapter 7 Counters and Registers

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

Laboratory Sequential Circuits

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

Laboratory Sequence Circuits

FLIP-FLOPS AND RELATED DEVICES

CPSC 121: Models of Computation Lab #5: Flip-Flops and Frequency Division

Reaction Game Kit MitchElectronics 2019

Registers and Counters

The University of Texas at Dallas Department of Computer Science CS 4141: Digital Systems Lab

Today 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Digital Fundamentals. Lab 5 Latches & Flip-Flops CETT Name: Date:

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

COMP sequential logic 1 Jan. 25, 2016

Logic Design. Flip Flops, Registers and Counters

RS flip-flop using NOR gate

Rensselaer Polytechnic Institute Computer Hardware Design ECSE Report. Lab Three Xilinx Richards Controller and Logic Analyzer Laboratory

A Combined Combinational-Sequential System

LATCHES & FLIP-FLOP. Chapter 7

CPSC 121: Models of Computation Lab #5: Flip-Flops and Frequency Division

Chapter 4: One-Shots, Counters, and Clocks

INTRODUCTION (EE2499_Introduction.doc revised 1/1/18)

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

COMP2611: Computer Organization. Introduction to Digital Logic

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) COUNTERS

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Digital Circuits I and II Nov. 17, 1999

1. Convert the decimal number to binary, octal, and hexadecimal.

Sequential Logic and Clocked Circuits

CS 261 Fall Mike Lam, Professor. Sequential Circuits

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

IT T35 Digital system desigm y - ii /s - iii

Laboratory 10. Required Components: Objectives. Introduction. Digital Circuits - Logic and Latching (modified from lab text by Alciatore)

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Computer Systems Architecture

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

EET 1131 Lab #10 Latches and Flip-Flops

EKT 121/4 ELEKTRONIK DIGIT 1

EE 367 Lab Part 1: Sequential Logic

EXPERIMENT #6 DIGITAL BASICS

Counters

Laboratory 8. Digital Circuits - Counter and LED Display

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

D Latch (Transparent Latch)

Mission. Lab Project B

Last time, we saw how latches can be used as memory in a circuit

Timing Pulses. Important element of laboratory electronics. Pulses can control logical sequences with precise timing.

STATIC RANDOM-ACCESS MEMORY

PHYS 3322 Modern Laboratory Methods I Digital Devices

BISHOP ANSTEY HIGH SCHOOL & TRINITY COLLEGE EAST SIXTH FORM CXC CAPE PHYSICS, UNIT 2 Ms. S. S. CALBIO NOTES lesson #39

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

Experiment 8 Introduction to Latches and Flip-Flops and registers

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Serial In/Serial Left/Serial Out Operation

Logic. Andrew Mark Allen March 4, 2012

Digital Circuits 4: Sequential Circuits

PLTW Engineering Digital Electronics Course Outline

Digital Electronics Course Outline

Lab #11: Register Files

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 1 1 Stop bits. 11-bit Serial Data format

EKT 121/4 ELEKTRONIK DIGIT 1

CHAPTER 6 COUNTERS & REGISTERS

CPS311 Lecture: Sequential Circuits

COMP2611: Computer Organization Building Sequential Logics with Logisim

MUHAMMAD NAEEM LATIF MCS 3 RD SEMESTER KHANEWAL

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

VeriLab. An introductory lab for using Verilog in digital design (first draft) VeriLab

EE292: Fundamentals of ECE

Spring 2011 Microprocessors B Course Project (30% of your course Grade)

Sequential Logic Notes

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

ECE 341. Lecture # 2

CHAPTER 4: Logic Circuits

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Digital Fundamentals: A Systems Approach

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

Sequential Logic Counters and Registers

Transcription:

Digital 1 Final Project Sequential Digital System - Slot Machine Joseph Messner Thomas Soistmann Alexander Dillman I. Introduction The purpose of this lab is to create a circuit that would represent the digital side of a slot machine. The slot machine would need many different parts in order to represent the all of the different lights one would see on an ordinary slot machine. The first step was to write code to upload to the Arduino Uno. Within the code, a random number generator would pick random numbers between a given range for each of the three slot machine displays. Once all three numbers match, the player has won and a row of red LED s, representing a slot machines general arrangement of lights, will sequentially light up, starting from the center LED and moving to the out most LEDs. When the player has not won, the lights blink simultaneously on an interval. To represent what the player sees while playing a slot machine, a method of representing the randomly spinning pictures on a slot machine was needed. The obvious choice was RGB LEDs, since these lights could cycle through various different colors, which would act as the slot machines display pictures. Once implemented correctly, the RGBs would randomly cycle through different colors one at a time, and would land on a color based off of the randomly generated number in the code written for the Arduino. Now, the colors on the RGBs effectively provide a visual aid for a slot machine player to see if they have won or not. II. Specifications In order to correctly implement the digital side of a slot machine, various different parts, inputs, and outputs were included. The first step was writing the proper code in the Arduino s computer software. This code was key in controlling the red LED light array and the RGB LED counter. The code was then uploaded to the Arduino Uno board, and the signals specified in this code were outputted to the breadboard. A pin on the breadboard also outputs the reset function to the Arduino, so that when the game is over after either a win or a loss, the entire circuit would automatically reset. Furthermore, the Arduino outputs the randomly generated numbers to the RGBs to control which colors are displayed when the game is played. Once all of the generated numbers match, the Arduino outputs a signal that triggers the LED light array. The light array sequentially lights up each LED s, starting from the center and fanning out symmetrically. To further add to the lighting effects of a slot machine, other functionality was added to pulse the LED light array in between the RGB counter cycling.

III. Design Discussion To implement the specified design, a device is needed that could cycle through the different colors that were available on the RGB LEDs. During the initial design process, it was determined that a D-Flip- Flop was needed, since it has the ability to store a bit of data every clock cycle. This can hold and output the value of 1 or 0 every cycle. In the case of LEDs, a Flip-Flop keeps the LED powered as long as a 1 is stored. For RGB LEDs, a three bit number is needed to produce the eight possible combinations. The combinations include Red, Green, Yellow, Blue, Purple, Teal, White, and Black or Off. With this in mind, three D-Flip-Flops are needed to power the three RGB LEDs. Knowing that the Flip- Flops store data every cycle, a method was needed to accurately run through the series of colors. The most effective method to do so, was to implement a ripple counter. A ripple counter would take the output from the previous Flip-Flop, and use it as the clock for the next Flip-Flop. This accurately multiplies the combinations of the circuit to the power of two. After this multiplication was completed, three D-Flip-Flops were provided eight total clock cycles to effectively display each of the combinations. However, a slot machine is not complete with only one reel, so three RGBs were used to represent the three reels on any typical slot machine. Therefore, a total of nine D- Flip-Flops (three per RGB) were needed to complete this portion of the circuit. Originally, this was the implemented design; however, due to errors in circuitry, one or more Flip-Flops did not cycle ideally. As a result of this error, other methods were experimented with, and eventually the ability to use a counter to combine the functionality of all the Flip-Flops was discovered (Figure 1). Each counter took the place of three Flip-Flops, resulting in a total of three counters (one per RGB) required to finally complete this portion of the circuit (Figure 2). Figure 1: Counters for the RGB LEDs. Figure 2: Two RGB LEDs wired to their corresponding counters. In order to control the cycling of the three counters and RGBs, code was written in the Arduino software that could perform the defined task. A random number generator was implemented in the code that chooses three random numbers (one per LED) between a specified range (Figure 3). After a random number was chosen, the counter would count down from this number to 0 (Figure 4). The difference between the chosen number and 0 directly correlates to the number of times the RGB will cycle. Pin 2 on the Arduino outputs to the first counter, Pin 3 outputs to the second counter and Pin 4 outputs to the third counter. If all three of these numbers are equal, another portion of code specifies another pin to produce a signal that controls the LED array (Figure

5). Pin 12 on the Arduino powers the LED light array in its sequential winning circuit for exactly 15 seconds, until the board is eventually reset by Pin 5. However, if the randomly generated numbers are not equal to each other, Pin 5 is high three seconds after the game is finished, and then the circuit is reset. Figure 3: Arduino code that specifies a range of counter cycles. Figure 4: Arduino code representing the comparison of randomly generated numbers. indicator LED (Figure 7). Another counter is in charge of creating the output signals that power the LED array (Figure 8). The three outputs used in the counter are wired to three inputs on a decoder. This decoder further splits the signals and creates the logic that makes the sequential array possible (Figure 9). Since this specific decoder has inverted outputs, a NOT gate integrated circuit was used to reverse the signal to the desired value (Figure 10). Next, comes the LED array itself, which only utilizes five of the outputs on the decoder to power the nine total LEDs. The second output from the decoder, after it is inverted, is wired to the middle LED, and the third output from the decoder is wired to the two LEDs adjacent to the left and right respectively. Finally, the fourth and fifth outputs are wired to the left and right of the previous LEDs on each side of the center LED respectively. Each LED was then connect to ground through a 1k resistors. However, the outputs from the decoder were not wired directly to the LEDs, instead they traveled through diodes to block any signal coming from another source (Figure 11). Figure 5: LED light array powered by Pin 12 of the Arduino and the secondary timer. The logic behind the sequential LED light array begins with a timer. A signal travels into the input pin of the timer via Pin 12 of the Arduino. The timer has various components that alter the speed of its output signal. In order to have a varying output pulse, a potentiometer was implemented into the circuit. A potentiometer is essentially a resistor that can vary its resistance based on the amount degrees rotated from its origin. The output pulse from this timer triggers the next branch in the circuitry along with an Figure 7: Timer with potentiometer and indicator LED outputting a signal to the counter

Figure 8: Counter receiving a clock signal from the primary timer in order to create a count signal for the decoder. Figure 9: Decoder which receives three input signals from the counter and outputs the proper signals to power the LED array. Figure 11: Diodes that stop the flow of current back towards other parts of the circuit. To add more functionality to the slot machine circuit, a blink function was added. Another timer was wired with a set pulse that turns all the LEDs on and off at one time (Figure 12). This acts as a standby function waiting for Pin 12 to output a signal. The output pin of the timer is connect to an indicator LED along with the LED array via diodes, thus stopping all unwanted signal from the sequential portion of the circuit, effectively isolating the LEDSs. When Pin 12 outputs a signal, it travels to the primary timer, like previously stated, and is put through a NOR gate, preventing the secondary pulse function from occurring while the sequential circuit is powered (Figure 13). Figure 10: NOT gate chip which inverts the signal coming from the decoder to properly cycle the LED light array. Figure 12: Secondary timer chip that controls the pulsing in between cycles of the RGB LEDs.

V. Appendix Figure 13: NOR gate which stops the secondary timer from cycling when Pin 12 on the Arduino is powered. IV. Conclusion Figure 14: Arduino Uno board used for random code generator and comparator to control the logic in this circuit. While the final product was successful, the only thing that had proved to be an issue was the original design which implemented the plethora of D-Flip-Flops. Besides for this hiccup, all other functionality of the circuit properly works. The RGBs cycle between all color combinations to represent the rapidly spinning visuals on a slot machine. The LED array fans out from the middle symmetrically like planned, and they also pulse in between victories to add to the various different lighting effects one would see when they sit down to play. While the circuit built in this lab does not represent an entire slot machine, it serves its purpose in representing the fundamental and most noticeable parts of the machine. When creating this project the work was split fairly equal. Joe Messner physically built the circuit and coded the Arduino while Tom Soistmann and Alex Dillman helped design. Tom created many of the used specifications, and wrote a significant portion of the lab report with Joe providing insight into some of the final circuits functionality. Alex put in his fair share of time coming up with ideas and writing the lab report as well.