Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

1

Simulation of Digital Dice


ANAS AYUB (2K19/EE/038), ANAND VARDHAN (2K19/EE/036)

EE- 306 MICROPROCESSORS & MICROCONTROLLER APPLICATION

MTE PROJECT REPORT

VI semester 21-22

Faculty Advisor : Aniruddha Bhattacharya


Dept. of Electrical Engineering, Delhi Technological University
2

INDEX

S.NO CONTENTS PAGE


NO
1 Introduction 3-5
● Digital Dice
● Abbreviations used
● Components used

2 Circuit Design Analysis 6

3 Circuit Diagram 6
4 Circuit Description 6-13
5 Simulation 14

6 Working 15

7 Conclusion 15

8 Reference 16
3

ABSTRACT
Dice is an important part of most of the traditional board games and the
project idea revolves about making this important tool digital. The digital
dice in any way would provide unbiased outcomes and thus a fair play.

Using the 7-Segment Decoder and timer, the dice would display randomised
numbers while the circuitry involves use of components like ( Timer, Clock,
7-segment display decoder etc). With Digital Dice, the aim is to replace the
traditional dice throwing to play games like monopoly, snakes and ladder etc
and make it more amusing.
4

INTRODUCTION

1.1 DIGITAL DICE


● A traditional dice is often a cube(range:1-6) that is thrown and a
random number appears.
● However, traditional Die often could be loaded/crooked to favour
biased outcomes.
● Digital dice is an alternative and smart device to display random
numbers (range: 1-9) on a 7-segment display.
● Switch controlled device, it produces unbiased outcomes and being
digital, it produces fair outcome only and could not be crooked.

ABBREVIATIONS USED

S. Abbreviation Full Form


No.
1 BCD Binary Coded Decimal
2 PB Push Button
3 IC Integrated Circuits
4 PLC Programmable Logic Circuit
5

COMPONENTS ASSEMBLED

S. Component Description
No.
1 IC 4017 16 Pin Decade counter, used to produce decoded
decimal count as output.
2 IC 74LS47 It accepts a binary coded decimal as input and
converts it into a pattern to drive a seven-segment
for displaying digits 0 to 9.
3 BCD to 7-segment Takes input from the Binary Adder to
Display decoder display numbers in the range (1-6).
4 IC555 Generates the input clock signal.

5 Voltage Source +5 V voltage source to drive the circuit


6 Push Button Acts as a switch to control the circuit.
6

Circuit Diagram:

Circuit Description

This gives a detailed description of the block diagram for the Digital Dice
game project. It discusses the main parts and also gives a detailed
explanation on the same.

Block Diagram
The main parts of the block diagram as shown in figure 1 are:

1. IC 555 Timer (Random Number Generator)


2. IC 4017 (decade counter chip)
3. Digital Dice Display
4. The seven – segment FND display
5. Reset switch
6. IC74LS47
7

Random Number Generator


The main aim of this part is to generate any number between 1 and 6
(inclusive) i.e. 3-bit binary number, similar to a cubic dice where each face
represents a number. However, the number generated in this circuit is not in
any kind of a predictable sequence and is in a perfectly random sequence
similar to an actual dice in such a game.

This is facilitated by the use of IC NE-555, which generates a series of


output clock pulses. The resistors and capacitors surrounding it formulate a
particular RC time constant and the IC then continues to generate output
clock pulses till the end of this time period. So, when the appropriate clock
pulse is obtained from the above discussed clock pulse circuit, the pulses
generated by IC NE-555 are fed to the next Integrated Circuit, Decade
8

Counter (IC – 4017) can also be used. The Binary Ripple Counter counts
from 0 to 5 i.e. 3-bit numbers provided the MSB (Most significant Bit) of the
counter is not considered. After the count reaches five, the Counter resets to
zero. When many clock pulses are received by it in a single time-constant
period, it counts from 0-5 many times and outputs any of these numbers.
This is known as Random Number Generation.

As shown, astable circuit connects the trigger pin to the capacitor. It adds a
resistor between the discharge and threshold pins. As mentioned astable
circuit triggers from the previous output pulse. Monostable circuit requires
an externally applied trigger.

In short, the output pin oscillates from high to low creating a series of pulses
as the capacitor charge oscillates from 33.3% to 66.6% Vcc, without any
external triggers.
9

However, the numbers obtained from the above procedure are between 0 and
5 (inclusive) and the desired numbers are from 1 – 6. This is taken into
account by including another Integrated circuit, Binary Parallel Adder (IC –
74Ls47) which increments the above generated number by 1 as it is between
0 and 5. The output of the Binary Parallel Adder is the final desired random
number which is then fed into the Digital Dice-Display circuit as shown .

4017 IC

4017 IC is a CMOS decade counter chip. It can produce output at the 10


pins (Q0 – Q9) sequentially, means it produces output one by one at the 10
output pins. This output is controlled through the clock pulse at PIN 14. At
first, output at Q0 (PIN 3) is HIGH, then with each clock pulse, output
advances to the next PIN. Like one clock pulse makes the Q0 LOW and Q1
HIGH, and then the next clock pulse makes the Q1 LOW and Q2 HIGH, and
so on. After the Q9, it will start from the Q0 again. So it creates sequential
ON and OFF of all the 10 OUTPUT PINs. Below is the PIN diagram and
PTN Description :
10

PIN description of 4017:

PIN NO. PIN Name PIN Description

1 Q5 Output 5: Goes high in 5 clock pulse

2 Q1 Output 1: Goes high in 1 clock pulse


11

3 Q0 Output 0: Goes high at the beginning – 0 clock pulse

4 Q2 Output 2: Goes high in 2 clock pulse

5 Q6 Output 6: Goes high in 6 clock pulse

6 Q7 Output 7: Goes high in 7clock pulse

7 Q3 Output 3: Goes high in 3 clock pulse

8 GND Ground PIN

9 Q8 Output 8: Goes high in 8 clock pulse

10 Q4 Output 4: Goes high in 4 clock pulse

11 Q9 Output 9: Goes high in 9 clock pulse


12

12 CO –Carry out Used to cascade another 4017 IC to makes it count upto 20, it is divide by 10 outpu
PIN

13 CLOCK inhibit Clock enable pin, should be kept LOW, keeping HIGH will freeze the output.

14 CLOCK Clock input, for sequentially HIGH the output pins from PIN 3 TO PIN 11

15 RESET Active high pin, should be LOW for normal operation, setting HIGH will reset the IC
(only Pin 3 remain HIGH)

16 VDD Power supply PIN (5-12v)

Digital Dice Display Circuit


The only purpose of this part is to show the face of the Dice corresponding
to the number generated by the randomizer circuit.

This is done with the help of a BCD – 7 Segment decoder which is used to
drive a common anode 7 segment display. The output of the above discussed
circuit forms the input for the BCD which then enters the input of seven –
segment decoder. The random number generated by the random number
generator circuit will be displayed on the 7 – segment display when the
13

button is pushed by a player. The number displayed is any number between


1to 6 in a complete random sequence.

Reset Switch
This is also a very important part of the game. The function of this switch is
to bring the game back to start from any point of time.

This is performed with the help of a Combinational Circuit and a


‘Push-to-OFF’ switch. This is a kind of switch which has its 2 ends always
connected, except when pressed/pushed. Thus, one end of the switch is
grounded. Therefore, by default this makes the clear inputs of all registers
HIGH. Here, the registers employ Active Low Clear inputs.

When the switch is not pushed, HIGH clear is fed to the registers via a NOT
gate. Therefore, normal functioning of all the registers is obtained.

IC74LS47

A Digital Decoder IC, is a device which converts one digital format into
another and one of the most commonly used devices for doing this is called
the Binary Coded Decimal (BCD) to 7-Segment Display Decoder.
7-segment LED (Light Emitting Diode) or LCD (Liquid Crystal Display)
type displays, provide a very convenient way of displaying information or
14

digital data in the form of numbers, letters or even alpha-numerical


characters.
Typically 7-segment displays consist of seven individual coloured LED’s
(called the segments), within one single display package. In order to produce
the required numbers or HEX characters from 0 to 9 and A to F respectively,
on the display the correct combination of LED segments need to be
illuminated and BCD to 7-segment Display Decoders such as the 74LS47
do just that.
A standard 7-segment LED display generally has eight (8) input connections,
one for each LED segment and one that acts as a common terminal or
connection for all the internal display segments. Some single displays also
have an additional input pin to display a decimal point in their lower right or
left hand corner.
In electronics there are two important types of 7-segment LED digital
display.

​ 1. The Common Cathode Display (CCD) – In the common


cathode display, all the cathode connections of the LED’s are
joined together to logic “0” or ground. The individual segments
are illuminated by application of a “HIGH”, logic “1” signal to the
individual Anode terminals.
​ 2. The Common Anode Display (CAD) – In the common anode
display, all the anode connections of the LED’s are joined together
to logic “1” and the individual segments are illuminated by
connecting the individual Cathode terminals to a “LOW”, logic
“0” signal.
15

Common Cathode and Common Anode Format

Electrical connection of the individual diodes for a common cathode display


and a common anode display and by illuminating each light emitting diode
individually, they can be made to display a variety of numbers or characters.

7-Segment Display Format

So in order to display the number “3” for example, segments a, b, c, d and g


would need to be illuminated. If we wanted to display a different number or
letter then a different set of segments would need to be illuminated. Then for
a 7-segment display, we can produce a truth table giving the segments that
need to be illuminated in order to produce the required character as shown .
16

SIMULATION

Simulation results :
SIMULATION VIDEO
17

RESULTS SCREENSHOTS :

1.2. WORKING OF DIGITAL DICE


● A 555-timer connected in ‘astable mode’ is supplied at 50Hz frequency
and it generates the input clock signal.
● The previously generated clock signal is provided as input to this
decade counter output system.
● These outputs are connected to a ‘BCD to 7-segment Decoder.
● The display decoder drives a common anode 7-segment display output.
18

● The connected push button (PB) is pushed to generate a square output.


● This square output is actually generated from the 555-timer when it
provides an approximate frequency of 50Hz to the 4017-decade
counter IC.

CONCLUSION

● This device could be easily and efficiently operated at a +5V voltage


input.
● The 555-timer generates a pulse when connected in ‘astable mode’ to
be fed to the circuit.
● All ICs are connected serially in a cascaded fashion.
● The traditional games are digitised with its use and offer more
transparency, smarter and fair play.
● The counter IC acts as a frequency division counter since it plays a role
in reducing frequency.
19

Applications:

1. This digital dice could be efficiently used in playing unbiased


traditional board games.
2. Snakes and Ladders, Monopoly, Business etc could be played using
this digital dice.
3. At higher order such systems are used even for lottery systems .

REFERENCES

I. https://www.electronics-project-design.com/digitaldice.html
II. http://www.gymhust.cz/obrazky-soubory/e-dice_v2.2_pupil_120227-c
77b2.pdf?redir
III. https://www.ukessays.com/essays/biology/the-digital-dice-game-biolo
gy-essay.php
IV. https://www.electronicshub.org/unbiased-electronic-dice-with-leds/#
Applications

You might also like