Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CAN YOU HELP ME IN MY VERILOG HDL CODE, THERE ARE SOME MISTAKES // Company: METU-NCC // Engineer: Your name goes here // Create Date:

CAN YOU HELP ME IN MY VERILOG HDL CODE, THERE ARE SOME MISTAKES

// Company: METU-NCC // Engineer: Your name goes here // Create Date: Date goes here // Design Name: Full Adder // Module Name: fulladd - Logicfunc // Project Name: Lab 1 // Target Devices: Cyclone III EP3C16F484C6 // Description: Full adder Verilog design // Dependencies: List code modules called by this module none here. // Revision: // Revision 0.01 - File Created // Additional Comments: Information to make the code easier to follow. //Structural Approach// module fulladd (A,B,Cin,S,Cout); output S,Cout; input A,B,Cin; wire w1,w2,w3; xor G1(w1,Cin,A,B); or G2(w1,A,B), G3(w2,A,Cin), G4(w3,B,Cin); endmodule G5(Cout,w1,w2,w3); endmodule

//Behavioral Approach, Continuous// module fulladd (A,B,Cin,S,Cout); output S,Cout; input A,B,Cin; wire (w1,w2,w3); assign S=!Cin; assign w1=A && B; assign w2=A && Cin; assign w3=B && Cin; assign Cout=B; endmodule //Behavioral Approach, Procedural// module fulladd (A,B,Cin,S,Cout); output S,Cout; input A,B,Cin; reg Cout; always @A,B,Cin if (Cin==0 & A==0 & B==0) begin S=1'b0; Cout=1'b0; end else if (Cin==0 & A==0 & B==1) begin S=1'b1; Cout=1'b0; end else if (Cin==0 & A==1 & B==0) begin S=1'b1; Cout=1'b0; end else if (Cin==0 & A==1 & B==1) begin S=1'b0; Cout=1'b1; end else if (Cin==1 & A==0 & B==0) begin S=1'b1; Cout=1'b0; end else if (Cin==1 & A==0 & B==1) begin S=1'b0; Cout=1'b1; end else if (Cin==1 & A==1 & B==0) begin S=1'b0; Cout=1'b1; end else begin S=1'b0; Cout=1'b1; end endmodule

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions