Beruflich Dokumente
Kultur Dokumente
1. Answers
1. The device that is used in this lab was a field-programmable gate array (FPGA) which is
an integrated circuit designed to be configured by a customer or a designer after manufacturing.
1|Page
2.
2|Page
3. If the Entity given name is different from projects name there will be errors and it will not
compile therefore, we should make Entity name same with projects name
4. The way to see the logic circuit as our result in this experiment is shown below
a. First click tool menu
b. Select Net list viewer
3|Page
Quartus II timing analyzer provide method of analyzing, debugging and validating the
performance and operation of the design. However, the procedure is to do time simulation is
shown below.
7. SW0 connect to Pin, AB28 SW1 connect Pin AC28 and LEDG0 connected to Pin E21
8. Because after entering the desired pin numbers for all signals in the pin Planner, then it will be
compiled again to check and test circuit operation at the developing board.
9. Yes, the procedure of this lab sheet is using the right flow from create new project until test the
circuit on board.
4|Page
2.0 design
2.1 Light controller and half adder design;
Source code of the light controller
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY Light IS
PORT (x1,x2:IN STD_LOGIC;
f:OUT STD_LOGIC);
END Light;
ARCHITECTURE LogicFunction OF Light IS
BEGIN
f<=(x1 AND NOT x2) OR (NOT x1 AND x2);
END LogicFunction
Truth table of the light controller
With the help of half adder, we can design circuits that are capable of performing simple addition
with the help of logic gates.
let us first take a look at the addition of single bits.
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 10
5|Page
These are the least possible single-bit combinations. But the result for 1+1 is 10. Though this
problem can be solved with the help of an EXOR Gate, if you do care about the output, the sum
result must be re-written as a 2-bit output.
From the equation it is clear that this 1-bit adder can be easily implemented with the help of
EXOR Gate for the output SUM and an AND Gate for the carry. Take a look at the
implementation below.
2.3 Half adder source code
Library ieee;
Use ieee.std_logic_1164.all;
entity halfadder is
Port ( in1, in2: in std_logic;
sum, carry: out std_logic);
end halfadder;
6|Page
3.0 Result
begin
7|Page
8|Page
Library ieee;
Use ieee.std_logic_1164.all;
entity ripple_carry is
port(A,B:in std_logic_vector(3 downto 0);
sum:out std_logic_vector(3 downto 0);
cout:out std_logic);
end ripple_carry;
architecture rtl of ripple_carry is
signal c:std_logic_vector(3 downto 1);
component fulladder is
port(a,b,cin:in std_logic;
sum,carry:out std_logic);
end component;
begin
u1:fulladder port map(a=>A(0),b=>B(0),sum=>sum(0),cin=>'0',carry=>c(1));
u2:fulladder port map(a=>A(1),b=>B(1),sum=>sum(1),cin=>c(1),carry=>c(2));
u3:fulladder port map(a=>A(2),b=>B(2),sum=>sum(2),cin=>c(2),carry=>c(3));
u4:fulladder port map(a=>A(3),b=>B(3),sum=>sum(3),cin=>c(3),carry=>cout);
end rtl;
9|Page
3.0 Result
3.1 Result of the activity one or Light controller
10 | P a g e
11 | P a g e
Result of the full adder circuit; This is our result so we add TWO circuits of halfadder then we
get one fulladder,
The full-adder circuit adds three one-bit binary numbers (a,b,Cin) and outputs two one-bit binary
numbers, a sum (S) and a carry (C). The full-adder is usually a component in a cascade of
adders. The carry input for the full-adder circuit is from the carry output from the circuit
"above" itself in the cascade. The carry output from the full adder is fed to another full adder
"below" itself in the cascade.
12 | P a g e
13 | P a g e
14 | P a g e
15 | P a g e
5.0 Conclusions
In this lab report it has made two different activities the light controller working same like switch
and half adder which is adding two numbers then producing two different results the sum and
carry. Both of contains basic logic gates. In the case, of the light controller, the negative and
positive values of the two inputs x1 and x2 are ANDed two times, resulting f0 and f1 , then
ORed to produces F2 final output which representing the LED. Furthermore, to that its also
designed full adder and ripple carry circuits, that is based on the principal of the half adder
circuit. In case of the full adder it is designed two half adders connected to gather to form full
adder circuit that have the ability to adder more than the half adder logic gate, while the ripple
carry consists of four adders and two output gates.
16 | P a g e
6.0 References
1. Monmasson, Eric, and Marcian N. Cirstea. "FPGA design methodology for industrial control
systemsA review." Industrial Electronics, IEEE Transactions on 54.4 (2007): 1824-1842.
2. Klingman, Ed. "FPGA programming step by step." Embedded Systems Programming 17.4
(2004): 29-37.
3. Andrews, David, Douglas Niehaus, and Peter Ashenden. "Programming models for hybrid
CPU/FPGA chips." Computer 37.1 (2004): 118-120.
4. Pellerin, David, and Scott Thibault. Practical fpga programming in c. Prentice Hall Press, 2005.
5. Thoidis, I. M., et al. "The circuit design of multiple-valued logic voltage-mode adders." Circuits
and Systems, 2001. ISCAS 2001. The 2001 IEEE International Symposium on. Vol. 4. IEEE,
2001.
6. Fayed, Ayman, and Magdy Bayoumi. "A low power 10-transistor full adder cell for embedded
architectures." Circuits and Systems, 2001. ISCAS 2001. The 2001 IEEE International
Symposium on. Vol. 4. IEEE, 2001.
17 | P a g e