Question

Write a VHDL program for Full-Adder. You should firstly write down the Boolean algebra expression of...

Write a VHDL program for Full-Adder. You should firstly write down the Boolean algebra expression

of SoP of the Sum and Carryout in terms of in1, in2 and Carryin and then simplify them. Use the

following abbreviations for the declaration in your answer:

Sum= S

Carryin = C

In1= A

In2= B

Carryout = Co

Compile and simulate using modelsim or others. Print out the waveforms of A, B, C, S and Co using

the ‘wave’ in the modelsim (or others). Your waveforms/time diagram should cover all the

combinations of A, B and C.

3. Re-do the VHDL program but use the ‘variable’ and ‘process’

Print out the waveforms of A, B, C, S and Co to confirm your program.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Boolean Algebra Expression for SUM:
= A’ B’ C + A’ B C’ + A B’ C’ + A B C
= C (A’ B’ + A B) + C’ (A’ B + A B’)
= C XOR (A XOR B)
= (1,2,4,7)

Boolean Algebra Expression for Carry-OUT:
= A’ B C + A B’ C+ A B C’ + A B C
= A B + B C+ A C
= (3,5,6,7)

VHDL Program for full Adder:

module Full_Adder( 
  input A, B, C, 
  output S, Co
  );  
    reg[1:0] temp;
   always @(*)
   begin 
   temp = {1'b0,A} + {1'b0,X2}+{1'b0,C};
   end 
   assign S = temp[0];
   assign Co = temp[1];
endmodule  
// fpga4student.com 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for full adder 
// Testbench code of the behavioral code for full adder 
`timescale 10ns/ 10ps;
module Testbench_Behavioral_adder();
 reg A,B,C;
 wire S,Co;  
 //Verilog code for the structural full adder 
 Full_Adder_Behavioral_Verilog Behavioral_adder(
    .A(A),
    .B(B),
    .C(C),
    .S(S),
    .Co(Co) 
   );
 initial begin
   A = 0;
   B = 0;
   C = 0;
   #5;
   A = 0;
   B = 0;
   C = 1;
   #5;  
   A = 0;
   B = 1;
   C = 0;
   #5;
   A = 0;
   B = 1;
   C = 1;
   #5;
   A = 1;
   B = 0;
   C = 0;
   #5;
   A = 1;
   B = 0;
   C = 1;
   #5;
   A = 1;
   B = 1;
   C = 0;
   #5;  
   A = 1;
   B = 1;
   C = 1;
   #5;  
  end
      
endmodule 

The wave diagram is as follows:

Add a comment
Know the answer?
Add Answer to:
Write a VHDL program for Full-Adder. You should firstly write down the Boolean algebra expression of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Do Simulate a 4bit Ripple Carry adder in Simulink and generate the VHDL code to be...

    Do Simulate a 4bit Ripple Carry adder in Simulink and generate the VHDL code to be implemented on DE2 board. Submit the VHDL code generated by the HDL coder and also screen shots from the DE2 board/ Quartus environment. 4 Bit Ripple Carry Adder A(3) B(3) A(2) B(2) A(1) B(1) A(0) B(0) А B A B Cout C64) А в A B C(3) C(2) C(1) C(O) Co Ci Со Ci Co Co Ci Cin S S S S Sum(3) Sum...

  • Write the source code for a 16-bit adder using the ‘+’ operator. Use the following information...

    Write the source code for a 16-bit adder using the ‘+’ operator. Use the following information as a guide: a. Use the names in the Adder Symbol/diagram above to name your block and its ports (all lower-case). For example dataa[15:0] signal name in VHDL would be dataa : in unsiged (15 downto 0); b. All inputs and outputs should be declared as type UNSIGNED vs STD_LOGIC_VECTOR. c. Do not worry about rollover with this adder. This adder is already wide...

  • C Programming For this task, you will have to write a program that will prompt the...

    C Programming For this task, you will have to write a program that will prompt the user for a number N. Then, you will have to prompt the user for N numbers, and print then print the sum of the numbers. For this task, you have to create and use a function with the following signature: int sum(int* arr, int n); Your code should look something like this (you can start with this as a template: int sum(int* arr, int...

  • write programs with detailed instructions on how to execute. code is java What you need to...

    write programs with detailed instructions on how to execute. code is java What you need to turn in: You will need to include an electronic copy of your report (standalone) and source code (zipped) of your programs. All programming files (source code) must be put in a zipped folder named "labl-name," where "name" is your last name. Submit the zipped folder on the assignment page in Canvas; submit the report separately (not inside the zipped folder) as a Microsoft Word...

  • Random Number Generation and Static Methods Write a program that simulates the flipping of a coin...

    Random Number Generation and Static Methods Write a program that simulates the flipping of a coin n-times to see how often it comes up heads or tails. Ask the user to type in the number of flips (n) and print out the number of times the coin lands on head and tail. Use the method ‘random()’ from the Math class to generate the random numbers, and assume that a number less than 0.5 represents a tail, and a number bigger...

  • write codes and give detailed explanation of how to execute. What you need to turn in:...

    write codes and give detailed explanation of how to execute. What you need to turn in: You will need to include an electronic copy of your report (standalone) and source code (zipped) of your programs. All programming files (source code) must be put in a zipped folder named "labl-name," where "name" is your last name. Submit the zipped folder on the assignment page in Canvas; submit the report separately (not inside the zipped folder) as a Microsoft Word or PDF...

  • Assignment Overview In Part 1 of this assignment, you will write a main program and several...

    Assignment Overview In Part 1 of this assignment, you will write a main program and several classes to create and print a small database of baseball player data. The assignment has been split into two parts to encourage you to code your program in an incremental fashion, a technique that will be increasingly important as the semester goes on. Purpose This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of...

  • In this assignment you are asked to write a python program to maintain the Student enrollment...

    In this assignment you are asked to write a python program to maintain the Student enrollment in to a class and points scored by him in a class. You need to do it by using a List of Tuples What you need to do? 1. You need to repeatedly display this menu to the user 1. Enroll into Class 2. Drop from Class 3. Calculate average of grades for a course 4. View all Students 5. Exit 2. Ask the...

  • CSIT 345 Lab 2 Process Programming Your lab requirement is to write program codes for 3.21 and sh...

    *Help Please with the code** CSIT 345 Lab 2 Process Programming Your lab requirement is to write program codes for 3.21 and shared memory program for producer and consumer as shown in the following. You can start with the code provided in the virtual machine in the virtual box you installed. The code can be found in /home/oscreader/osc9e-src/ch3 a. For 3.21, you can start with the newprocposix.c and modify the code to meet your requirement. Then type: gcc neypCOCROSİS.c to...

  • This C++ Program should be written in visual studio 2017 You are to write a program...

    This C++ Program should be written in visual studio 2017 You are to write a program that can do two things: it will help users see how long it will take to achieve a certain investment goal given an annual investment amount and an annual rate of return; also, it will help them see how long it will take to pay off a loan given a principal amount, an annual payment amount and an annual interest rate. When the user...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT