Documente Academic
Documente Profesional
Documente Cultură
Hardware
On the FPGA itself.
Inputs:
A (1 bit) B (1 bit) Cin (1 bit)
Cout
Cin
Outputs
Sum = A xor B xor Cin Cout = AB + BC + AC
SUM
Notes
Libraries of the IEEE are analogous to the Libraries Import in JAVA. Entity: defines the Input (in) & Output (out) ports. Architecture: Comprises the Body of the code (Analogous to the Main Method in JAVA) STD_LOGIC means the value of this port will be 0 or 1 STD_LOGIC_VECTOR means the value of this port will be a Vector (array) of Zeros and Ones.
<= : This sign says that the value of (A xor B xor C) is assigned to the SUM (similar to this arrow ) xor, and, or, not : Logical operators are written as words !!
Cout
1-Bit Adder
SUM 3
w3
1-Bit Adder
SUM 2
w2
1-Bit Adder
SUM 1
w1
1-Bit Adder
Cin= 0
SUM 0
Unit 4
Unit 3
Unit 2
Unit 1
Cout
1-Bit Adder
w3
1-Bit Adder
w2
1-Bit Adder
w1
1-Bit Adder
Cin= 0
SUM 3
SUM 2
SUM 1
SUM 0
Unit 4
Unit 3
Unit 2
Unit 1
< Index > : 3 2 1 0 A (4 bits) :0110 B (4 bits) :1011 --------------------------------Sum (4 bits) :1111 Cout (1 bit) :0010
A3 B3 A2 B2
Cout
1-Bit Adder
w3
1-Bit Adder
w2
1-Bit Adder
w1
1-Bit Adder
Cin= 0
SUM 3
SUM 2
SUM 1
SUM 0
Unit 4
Unit 3
Unit 2
Unit 1
Entity Declaration
Input ports :
Architecture
Component and Signal are placed above the Begin and End of the Architecture
Architecture
Component Object of the (1-bitadder) <Copy the bitadder entity inside the component> Analogous to the Constructor headings in Java, however its initializations (architecture) are in the bitadder file
Architecture
Signal w1, w2, w3 represents the Carry outs of the 1-Bit adder UNITs (1,2,3) Inside the (4 Bit Adder) w1, w2, w3 Temporary values
1.
2.
1.
Label
2.
3.
* VHDL (Output/Returned values) are returned in the brackets.<PORT> * Java (Output/ Returned values) are stored to a NEW variable.
A3
B3
A2
B2
A1
B1
A0
B0
Cout
1-Bit Adder
w3
1-Bit Adder
w2
1-Bit Adder
w1
1-Bit Adder
Cin= 0
SUM 3
SUM 2
SUM 1
SUM 0
Unit 4
Unit 3
Unit 2
Unit 1
Feel Free to ask any question and help in improving these slides by your highly appreciated feedback.