Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

4 bit to 8 bit ALU conversion

Status
Not open for further replies.

Proton01

Newbie level 1
Joined
Mar 17, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
13
Hi guys, I am currently studying an electrical engineering degree and have designed a 4 bit ALU as part of an assignment.
I have been asked how I could easily convert it to an 8 bit ALU? My answer currently stands that I would alter all of the modules (add, sub, bux, or xor LS RS and etc) to 8 bit ones. as well as the switch numbers for the fpga board in the ALU module. is this the easiest way or would I be able to design the ALU to call on each 4 bit gate twice or add the 4 bit modules a second time with a diferent name?
I feel as though I have exhausted my textbooks and the net, which is frustrating as the information must be out there!
For info I am using Quartus II to program

Your help would be much appreciated

Mark
 

One of the advantages of using loop statements in HDL to declare some structure ( e.g.for ), is that you can easily change the parameter of the size of the bus, so that a priori, this could easily be made parametrically.
 

Along the lines that andre mentioned, I would suggest that you redesign what you have so that each module that has currently a dependency on a hard coded bit width be changed to use a generic parameter input that defines the bit width. Get that working with the generic set to 4 (i.e. your current bit width) and then 'in theory', all you need to do to get an 8 bit ALU is change the generic to 8.

You can still expect to have to debug some issues with the new value but those debug issues will likely be along the lines of uncovering hidden or implicit places where you have assumed a 4 bit width and didn't catch it when converting the design to work with a generic width.

Just because you didn't start your design with a generic width doesn't mean that you can't convert it to become such a design. In fact, that is a typical design migration path where some assumed constant on the first rev of the design changes to become either a hard coded parameter (such as a module generic as I've mentioned here) or even a soft parameter that can be controlled via some external controller. Usually the best approach when confronting that type of situation is not to rewrite all that you have for some new condition, but instead to parameterize your current design and test that it works with both the original setting as well as the new setting.

Kevin Jennings
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top