ALU is the acronym for arithmetic and logic unit. This circuit performs arithmetic and logic operations in a processor.

learn more… | top users | synonyms

2
votes
2answers
121 views

Why does my ALU design delay outputting the results for two clock cycles since input of valid data?

Hello EE StackExchange! I have been trying to design a simple 8-bit CPU for several months now. However, I am experiencing a problem: The ALU outputs the result of the operation two clock cycles ...
0
votes
3answers
80 views

How do I make a 4-bit comparator?

I'm making an ALU (Arithmetic and Logic Unit), I've made a 1-bit ALU with ease, but 1-bit (1b) is impractical, who would need only 1b? I've made that adder/subtractor and I need the comparator ...
3
votes
3answers
94 views

How was the Zero Flag implemented on Z80 ALU?

Z80 was a popular 8-bit processor with a 4-bit ALU. Implementing a zero flag for a register should be straight forward, it would be a logical NOR of all the bits ...
0
votes
1answer
42 views

Carry look ahead adder with 2-input gates?

I would like to make a 8 bit adder, with carry look ahead, but i only have 2-input logic gates. All I've heard about use some at least 4-input gates. Or do I need to use a totally different method, ...
1
vote
3answers
31 views

Is there any difference between using a decoder for the alu op code vs using a multiplexer?

I am a programming student studying electrical engineering fundamentals on the side. I have come across two different methods for getting the result of an operation onto the bus. A decoder accepts ...
0
votes
2answers
63 views

Choosing ALU functions

I am currently taking the Nand2Tetris course online, where I am in the process of building a virtual computer all from nand gates. I have learned what an ALU is, how it works, and build a simple ...
0
votes
1answer
186 views

Equality 4 bit with 4 bit by IC 74181 (ALU)

Pin 14 in IC 74181 when 2 numbers (4bit) equal this pin must be high. This pin is open collector. I connect this pin to Vcc & Res but not high or red. I've created this circuit in Protheus. ...
2
votes
7answers
1k views

Why are 11, 111, 1111, … equivalent to -1 in two's complement? [duplicate]

According to two's complement, the binary numbers 111 and 11111111 are equivalent to -1. Why or how are the binary numbers 11, 111, 1111, 1111 1111, etc. equivalent to -1 in two's complement? Can ...
3
votes
3answers
213 views

Why All 1's used as a second input in decrement operation of ALU?

Suppose the first four data inputs are X (X0, X1, X2, X3) and the second four data inputs are Y (Y0, Y1, Y2, Y3) in a 4-bit ALU. Why "All 1's" are used as an input for Y in the decrement operation of ...
-1
votes
1answer
69 views

Can a microprocessor ( specifically the ALU) be considered as an FPGA that is re-programmed by the Instruction Decoder

So, I have been reading about FPGAs. As I understand, they work by providing logic blocks for the programmer to link together to solve a particular task. Many such tasks may run in parallel; so an ...
-1
votes
1answer
100 views

Wallace tree multiplication rules

I was looking at this wallace tree diagram for an 8x8 multiplier: and I'm confused about why the pairs of two (and the one pair of 3) are not added together in the initial reduction layer. My ...
0
votes
1answer
35 views

Learning about multipliers, confused about cycles in relation to Wallace tree

At this link: http://en.wikibooks.org/wiki/Microprocessor_Design/Multiply_and_Divide_Blocks It says that a wallace tree can be used to perform multiplication in a single cycle. I'm assuming then ...
0
votes
1answer
82 views

Implementing Integer Division in hardware

I am trying to figure out how to create an efficient way to divide 5 bit numbers in hardware (using registers, Shift Registers, Comparators, Muxes, basic logic gates, bit shifters, bit extenders, and ...
2
votes
3answers
105 views

Curious how does ALU addressing work like in Assembly code?

When writing assembly code, say R1 = R2 + R3, it is pretty easy to understand the addressing procedure because all registers are close to the ALU. But I find it hard to see how does the ALU go to the ...
0
votes
0answers
44 views

How can I connect this ram-ish memory layout

In the picture on the web, I want to connect the two inverters that are ringing around each other, I want to connect them to the data-line. I can't seem to figure out how to properly connect them in ...
0
votes
2answers
111 views

How does Decimal Mode in an ALU work?

Trying to wrap my head around the basic of how to do decimal addition in an ALU. Here is what I have so far. I am primarily looking at the MOS 6502 CPU architecture. It has two modes in which you ...
1
vote
2answers
361 views

How do you do operations on large numbers using a small fixed-width ALU?

I am wanting to design a simple calculator like what you would find in the dollar store. Something like this: This little guy can display a number 8 digits long, meaning 99999999 is the largest ...
0
votes
0answers
34 views

Help with harder version of carry chain adder?

I am designing an addr circuit given cin = 0, given a nand of the operands i want to add, their xor, and nor. I have drawn it in a software but i am not getting the right output, i have tried to ...
0
votes
1answer
119 views

How to reduce an ALU logic with the minimum logic possible? Its very challenging

Our professor wants us to reduce 8 function alu (8 outputs) to a 4 out ALU that has capability to implement all the 8 functions. We can use any gates(even aoi's), muxes, and can create our control ...
-4
votes
2answers
241 views

I need help with verilog code, I am in trouble?

I am basically setting different control signals for the ALU to perform operations in verilog. But I have tried all possible ways of writing what I want but in vain, can you help me out. How should I ...
1
vote
1answer
62 views

How do you reduce an 8 output ALU to a 4 or 3 output ALU?

I can implement the functions in the picture below, but then if I implement them independently, I would have 8 outputs to the mux. Our professors wants us to reduce the ALU to only 3 or 4 outputs, I ...
0
votes
0answers
288 views

How ALU Perform decrement operation using LOGIC Zero

I google many ALU Block diagram for decrement operation.all same as shown below. This 1 bit alu perform 8 operation depending upon select line status Theoretically all operation seems works ...
-2
votes
1answer
159 views

Would it be practical to build a chip that can do this math?

I was theorizing a new kind of 64-bit number for use in data storage, but then started wondering if it could become practical if created in hardware. (I believe it would be too slow if only software ...
1
vote
1answer
120 views

How is the zero flag set in terms of hardware? [duplicate]

I'm angling this as a general question on the assumption that it doesn't differ significantly with architecture - at least at the level I'm asking. I'm curious how - in terms of hardware, not the ...
4
votes
1answer
11k views

How to shift left/right a STD_LOGIC_VECTOR value within a WHEN statement?

I'm attempting to create a parametrizable ALU which handles N-Bit signed data. However the methods I know of shifting left/right, either won't work because the values are defined as STD_LOGIC_VECTOR: ...
1
vote
1answer
114 views

CISC, microcode execution flow

Say we have 16 bit processor and such CISC instruction: 0001 0010 0100 1000 As far as I understood from the answer on related question In the process of decoding, this CISC instruction will be ...
0
votes
1answer
368 views

Active high and active low in IC

I am using an alu SN74ls181 . I am unable to figure out how active high and active low are decided . Is it during the manufacturing or some circuit parameters decide if the circuit is active high or ...
4
votes
1answer
449 views

Creating an ALU slice with 8 operations

Hey, I'm trying to implement a 4bit ALU based on this 8bit alu design. The ALU has 8 different operations, given by an input of X Y Z The 8 operations are (edit: the last one is just A not, made ...
3
votes
1answer
160 views

Are there gate-level ways to produce the min or max of two binary values?

Some basics of digital logic are the half adder and full adder. We know how to produce the sum of two binary values at the level of and/or/not gates, in a straightforward way presented in many ...
3
votes
3answers
383 views

Design ALU with 2 Select lines, 2 Inputs ( n bits )

I want to design ALU with 2 select lines , 2 inputs ( n bits ) that do the following: this is a homework and I want to know what to do, writ to me the steps for design it. the first thing I thought ...
2
votes
2answers
233 views

Trouble on understanding ALU 2-bit design

I'm new to this site and I'm pretty "noobish" to electrical engineering coming from a software engineering background I was hoping someone could help me understand this design a bit. I've highlighted ...
2
votes
2answers
579 views

Is the registry file made from SRAM?

I study computer engineering and I read Hennessy's book about Computer Organization where it's described how the microprocessor does pipelining and that the microproceossor has on-chip cache, as much ...
0
votes
1answer
374 views

What's the difference between delayed branch and branch prediction?

I'm studying how delayed branch works and I'm trying to distinguish delayed branch from branch prediction. What is the difference? Is delayed branch a means to facilitate a control hazard?
0
votes
1answer
197 views

What to change when migrating designs from Altera DE2 to DE2-115?

I'm migrating a working design from Altera DE2 to Altera DE2-115 and I'm running into problems. First everything works with DE2 just like mentioned in the exercises doing what is instructed. Now I ...
-2
votes
1answer
77 views

Getting my head around ALUs

What is a good place to start understanding about ALU's? Lots of sites seem very over the top and complex, can anyone recommend a good place to start? Thanks in advance, James
1
vote
1answer
591 views

4 Bit ALU addition

What are the values of the Z, V, C and N bits in the status register after the operation 1000 + 1111 for a 4-bit ALU?
3
votes
1answer
252 views

Parallel multiplication hardware

This picture is taken from Computer Organization and Design, Fourth Edition, David A. Patterson, John L. Hennessy. Sorry for the low resolution. I cannot get my head around it. I can see why the ...
0
votes
1answer
195 views

Why is carry on for an adder that is simply on? [closed]

I've understood that the behaviour is correct when I make a simple adder: But why does carry on light up just because I switch on the + operation for my 4-bit system? ...
-1
votes
1answer
126 views

Running the linux kernel and ubuntu on a custom processor [closed]

This is hardly a theoretical question as many have done this, albeit there's very little information on the underlying processes. I'm developing a custom MIPS-based processor on which I would like ...
2
votes
3answers
679 views

Confused as to how implement ALU using structured VHDL

I am new to VHDL, working on assignment for my Computer architecture class: implement 32 bit ALU using VHDL, that performs only certain operations: and, ...
8
votes
3answers
1k views

Designing a simple ALU

I need to design an ALU with two 8-bit inputs A and B and control inputs x, y, and z that supports the following operations: ...
1
vote
3answers
245 views

Pipeline and real parallelism?

I have read several articles which say that the CPU has the ALU (and other small specific execution units), Control Unit and the Registers and well other buffers/pipelines, internal buses etc. The ...
7
votes
2answers
2k views

Are 32-bit ALUs really just 32 1-bit ALUs in parallell?

I'm reading the high esteemed text Computer Organization where this picture is found that is supposed to represent a 32-bit ALU: Is this technology really how it's done, just a lot of 1-bit ALUs, so ...
3
votes
2answers
915 views

CU or ALU? What communicates with memory?

I have different books saying different things. Are the address bus and data bus connected to the CU or the ALU? The control bus connects to the CU right?
3
votes
1answer
3k views

What's wrong with this 4-bit ALU?

I've put together a 4-bit ALU that seemed to perform correct in simulation but when downloaded to the board it is not behaving correctly. The operation OR behaves correctly while addition and AND are ...
3
votes
1answer
236 views

Custom-CPU builder/simulator

I googled deeply but couldn't find any cpu constructor simulator. I'm specifically hoping to learn about the operation of the northbridge, but When I googled "bridge simulator" or "bridge (the ...
4
votes
2answers
415 views

How to design system for n bits?

Say I want to design an n-bit system e.g. 256 bits. Can I generalize a 4-bit ALU which I think I know to 256 bits? These are my diagrams.
4
votes
5answers
2k views

Is an ALU a multiplexer?

I'm studying digital electronics where the components ALU and multiplexer appear. To me the ALU seems like a multiplexer but it's not specifically mentioned that this is the case. Is it so, or why ...
3
votes
4answers
1k views

How does a chip interpret different opcodes?

I have learnt in school about opcodes and how it works with the ALU to add numbers and such, now is my question how the computer is able to understand this, because it is codes and the computer needs ...
1
vote
1answer
894 views

Need help figuring out simple multiplication hardware

As a part of my Computer Organization course, I need write to write a simple program (in C) that mics the work of "refined multiplication hardware" just like one shown in "Computer Organization and ...