Professional Documents
Culture Documents
FPGA Based Digital Electronic Education, Data Entry Organization For A Calculator
FPGA Based Digital Electronic Education, Data Entry Organization For A Calculator
Streszczenie. W artykule przedstawiono program szkoleniowy dla studentów, dotyczący projektowania kalkulatora w układzie FPGA (ang. Field
Programmable Gate Array). (Implementacja kalkulatora w układzie FPGA jako element edukacji w zakresie techniki cyfrowej)
Fig 1a : Devoting numbers to buttons and saving them into 4 bits DFFs
CLRN
inst exp dff exp dff exp dff inst14
high PRN PRN PRN
exp dff exp dff Q Q Q
high D D D
PRN PRN NOT8_digits_f e
D Q D Q /Q /Q /Q
/Q /Q inst16
CLRN CLRN CLRN
AND2
inst8 inst12 inst18
CLRN CLRN
inst6 inst9
comma-1 sy s_clk
inst10
OUTPUT comma_to_data_entry
sy s_clk OR2
OUTPUT zero_out_to_Po
DFFE
high exp dff exp dff inst11
PRN
D Q high PRN PRN
pin_0 D Q D Q
sy s_clk DFF DFF
/Q /Q comma PRN PRN
ENA D Q D Q
CLRN sy s_clk
dff exp CLRN CLRN
high inst7
PRN inst5 inst17
Q D
CLRN CLRN
/Q 5 6
DFF DFF AND2
CLRN button_pulse PRN PRN comma-1
NOT
inst36 D Q D Q
sy s_clk
13
14
inst2
8_digits_f e NOT
OR2
CLRN CLRN
inst3 3 4
connect AND2
comma_to_data_entry connect
NOT
11
12
Fig 2a : The circuit which is organized for exceptional work of the zero and comma buttons.
The simulation result of the circuit can be seen at Fig 2b. below related to data entry module from the last design
The first two pulses applied to system are ‘Pin_0’ Pulses of study.
0_button. At this period, there is no any signal on the When you press a button, the ‘Button_pulse’ signal must
output called “zero_out_to_P0.” After pressing comma be generated
button, first zero signal then comma signal is generated. Following the ‘Button_pulse’ signal, Triple pulses must be
generated and sent to the output called ‘clik_for_shift_taps’
Following the first ‘Button_pulse’ signal, down counter
(from 8 to 0) must be active and it must continue to count
after each ‘Button_pulse’ signal.
Following the first ‘Button_pulse’ signal, the ‘Any button’
signal must be high and it must keep its level till the digits
of the number reache to 8
‘Any Process’ signal must be generated when any button
related to arithmetic operations is pressed.
Fig 2b : Simulation results related to usage of zero and comma Following the ‘Any Process’ signal after its becoming High,
buttons. if the digit of the number is not equal to 8, the rest digits
must be completed to 8, meanwhile, the value at the out of
Design of Data Entry Module
down counter must be written to 4 bits DFF register.
This module is the main module of the Data entry
IF comma button is pressed, down counter must go on
Organization part of the calculator. Several important
operations related to preferred method of calculation are counting (to protect data loss at output ‘clk_for_shift_taps’
), but the value at the out of down counter must be written
completed here. Some of these operations are as follows.
to 4 bits DFF register with comma signal.
Converting each entered numbers to 8 digits (32
If the entered number has reached to 8 digits, the ‘Any
bits) temporary numbers,
Process’ signal must be low.
Saving the difference between entered number
The number saved at 4 bits DFF must sent to output
and 8 digits temporary number in as power of the number.
q[3..0]. This value also must be saved to another register at
Generating triple pulses for Shift Taps Component
out of the module. For his purpose, the value of 4 bits DFF
after entering each digit of the number
must be sent to output ‘save _number_mpower’.
Generating some important signals to be used in
The circuit of data Entry Module prepared according to the
other modules.
rules can be seen at Fig 3a. There are only DFFs
At first glance this module can be found complicated, Zero-
connected to the DFF rows at the missing part of the
comma module before this module provides a great
picture (right part) and its simulation results can be seen at
convenience. These two modules help students/new
Fig 3b.
designers to understand how to develop a design and how
to convert rules to electronics circuits. These rules are very
important in term of educational purposes. There are rules
INPUT /Q /Q /Q /Q /Q /Q /Q
any _entry
VCC exp dff
high PRN prcss CLRN CLRN CLRN CLRN CLRN CLRN CLRN
exp dff
D Q inst39 inst13 inst14 inst15 inst18 inst19 inst20
INPUT PRN
any _process D Q /Q
VCC sy s_clk
/Q
CLRN
inst42
CLRN
inst1
AND2
exp dff exp dff exp dff exp dff
exp dff sy s_clk_2 high
INPUT DFFE PRN PRN PRN PRN
button_pulse PRN D Q D Q D Q D Q
VCC NOT
D Q inst28 PRN
sy s_clk OR2 /Q /Q /Q /Q
D Q
/Q inst17
CLRN CLRN CLRN CLRN
CLRN inst26 ENA inst inst4 inst5 inst6
Dp_out duble_dp AND2 CLRN
inst38 sy s_clk
inst16
connect-1
inst41
OUTPUT 8_digits
exp dff exp dff exp dff exp dff
high PRN PRN PRN PRN
Q Q Q Q DFFE
D D D D NOT
Dp_out PRN
/Q /Q /Q /Q D Q
inst7
CLRN CLRN CLRN CLRN
inst47 inst35 inst36 inst37 ENA
CLRN OUTPUT clk_f or_shf _taps
sy s_clk_2 inst2
exp dff exp dff
high inst33
OR2 PRN PRN
comma D Q D Q
sy s_clk
prcss exp dff
/Q /Q
AND2 PRN OUTPUT
D Q sav e_number_mpower
inst34 sy s_clk
CLRN CLRN
inst3 inst12 /Q
DFFE
PRN NOT lpm_counter0
D Q 8_digits down counter CLRN
inst48 clock modulus 8 lpm_dff1 inst43
connect-1 clk_en DFF
ENA q[3..0] data[3..0]
CLRN duble_dp OUTPUT q[3..0]
q[3..0]
inst46 cout clock
aclr
aclr
CLRN
inst11
As can be seen at Fig 3b, there are two data entry period ‘Lpm_Mult’ components can be seen in Fig 4a; one under
at simulation report page. At first period (till to point of the other.
24.2944 us) there is only comma operation while button
pulses are going on. When the comma button is pressed at
the point of 10.24 us, the number at the output of down
counter is sent to 4 bits DFF register but meanwhile,
number entering and generating of triple pulses for Shift
Taps Component goes on. At second period, ‘any process’
button is pressed after two ‘button_pulse’ signals and the
rest digits are generated automatically (point of 30.72 us).