Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

4-bit ALU

Posted on 2004-08-28
9
Medium Priority
?
515 Views
Last Modified: 2007-12-19
hi
     i have searching the net for a good 4-bit alu design.i wanted a little help in this regard.
                              thanks
0
Comment
Question by:mack123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 18

Expert Comment

by:JR2003
ID: 11923582
What are you looking for?
Is a circuit that will take four 4-bit numbers a, b, c and d and will evaluate: a+ b + (c * d) what you are looking for?
0
 
LVL 27

Expert Comment

by:aburr
ID: 11924143
you could use half the capabilities of a Z80 chip.
also look at the Basic Stamp series of chips
0
 
LVL 84

Expert Comment

by:ozo
ID: 11924173
Could you use a 74LS181 or 74F382 ?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mack123
ID: 11924199
any ic's could be used except the ALU ic.it has to be implemented.
so 74LS181 certainly cannot be used
0
 

Author Comment

by:mack123
ID: 11924206
please if u find it on a website ,please do tell me.
0
 
LVL 84

Accepted Solution

by:
ozo earned 1050 total points
ID: 11924210
0
 
LVL 18

Expert Comment

by:JR2003
ID: 11924913
This has the logical gate layout of 74LS181 which you could implement useing ICs with just ANDs, ORs and NOTs
http://www.visc.vt.edu/~mhsiao/ece4504/project/proj0/181_datasheet.pdf

Another simple solution is to use a programmable EPROM as a lookup taable. If you get one with 16 inputs and 16 outputs you can have a circuit that will do an operation on 4 4-bit numbers and produce a 16 bit result. The maximum result of the operation A + B + (C * D) where A, B, C and D are  4-bit numbers is exactly (2^16)-1 - the maximum 16-bit number which would fit in nicely with your requirement.
0
 
LVL 18

Expert Comment

by:JR2003
ID: 11924998
oops, I meant to say that you could get an EPROM with 16 inputs and 8 outputs!


Another simple solution is to use a programmable EPROM as a lookup taable. If you get one with 16 inputs and 8 outputs you can have a circuit that will do an operation on 4 4-bit numbers and produce a 16 bit result. The maximum result of the operation A + B + (C * D) where A, B, C and D are  4-bit numbers is exactly (2^8)-1 - the maximum 8-bit number which would fit in nicely with your requirement.
0
 
LVL 22

Expert Comment

by:grg99
ID: 11925243
"an ALU" is a pretty broad description...

A 4-bit ALU is just like a 1-bit ALU, only 4 times wider and with some carry wires added.

A 1-bit ALU probably takes in TWO 1-bit inputs and generates a 1-bit output and a carry.  Since it's a "ALU" it probably should do at least add, subtract, and, and or.


For the add part, you need a 1-bit adder with carry.  That's a XOR gate for the output, an AND gate for the carry.

For subtract, you just need a way to negate the second input bit. That's another XOR gate.

For the AND and OR parts, you need an AND gate and an OR gate.

To make the function selectable, let's say you have a 2-bit op-code coming in:

00 ADD
01 SUB
10 AND
11 OR

You use the FIRST bit to select enable either the arithmetic section or the logical section.

You use the second bit to enable the add/and versus the sub/or.

Pretty easy, jsut a few gates, with the outputs either gated together, or tri-stated to the output.

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a brief introduction to tissue engineering, the process by which organs can be grown artificially. It covers the problems with organ transplants, the tissue engineering process, and the current successes and problems of the tec…
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question