04-05-2014 03:40 PM
I need to do this "Take in two 4 bit inputs (A and B), adding them
together, and then decoding the result into a format that a 7 Segment display
supports. You must also indicate any overflow with an “o” on the display."
I'm struggling on how to do this very much, our professor JUST introduced us to Xilinx and told us to do this with no prior knowledge of circuits...
module Proj2Module( input [3:0] a, input [3:0] b, output [3:0] sum, output carry ); wire cin; assign cin = 1'b0; SingleStage s0( .a( a ), .b( b), .cin( cin ), .s( sum), .cout( ripple0 ) ); SingleStage s1( .a( a ), .b( b), .cin( ripple0 ), .s( sum), .cout( ripple1 ) ); SingleStage s2( .a( a ), .b( b), .cin( ripple1 ), .s( sum), .cout( ripple2 ) ); SingleStage s3( .a( a ), .b( b), .cin( ripple2 ), .s( sum), .cout( carry ) ); endmodule
An Xilinx wiki says that this adds up two 4 bit inputs.. but how do I decode this into something a 7 segment display can use?
Extremely frustraited and confused, any help would be appreciated.
04-12-2014 11:55 PM
Suggest you ask your instructor. It is the instructor's job to provide you with instruction and guidance sufficient to answer classroom assignments. If this is not happening, the instructor needs to know.
If you want to understand 7-segment displays, suggest you learn the use of web search engines.
If you want some quick, simple FPGA design examples, try www.fpga4fun.com.
-- Bob Elkind