# Tagged Questions

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

44 views

### Is it possible to execute a left shift in a single clock pulse? [duplicate]

I am currently designing my own 16 bit CPU and want to have a logic left shift instruction. I can make it shift only 1 position easily, but I want it to shift it b positions. Is that possible in a ...
62 views

### Simple methods for synthesizing circuits [closed]

I'm studying systems engineering and I am currently attending a course in computer architecture. In our career, we don't have much training in regard to hardware, so we find very hard to synthesize ...
572 views

### What does the logic statement “F = AB” mean? Bitwise A AND B?

On an ALU data sheet there are logic formulae showing the results that will be output for various inputs. http://www.farnell.com/datasheets/1840939.pdf (Second from last row on page 3.) I assume ...
71 views

### Designing a 8 bit ALU

I have started designing a 4 bit Arithmetic and logic unit. The sample image is as follows: The function Table: My question is: Is it possible to design an 8 bit ALU having the same ...
53 views

### Designing an ALU circuit

Given this picture, I am trying to build an ALU circuit. A, B, and K are 8 bit inputs. I am not sure how to implement operations 6 and 7. I would like to implement this using only multipliers and a ...
106 views

### Display Double Digit Numbers on 2 seven segment displays

I'm making an Arithmetic Logic Unit(ALU) for an assignment and I'm on a point. So according to my circuit design on the link shared below, I am able to output 1 digit of my alu. It is a 4 bit ALU so ...
169 views

### How do bitshifts work on the electrical layer?

I'm a software developer and I understand how arithmetic and logical bitshifts work in principle. But how do they work on the electrical layer? I might have a completely wrong imagination; Let's ...
255 views

### Verilog 8 Bit ALU

Here's what I have so far but I'm stuck with what to do for the f values for the last two and whether the if statement syntax is correct. Any tips? ...
265 views

### Eight bit ALU with Overflow in Verilog [closed]

I have the above assignment and here's what I have so far in verilog: ...
95 views

### Does an ALU always do add and sub, but only returns one of the results?

Pretty simple question. Does an ALU internally always do multiple operations like add, sub, div, mul, ... and you simply have to specify which result you want to return? I was told that it does that, ...
91 views

### Is the ALU control unit enough to execute all the instructions in a MIPS processor?

The ALU control unit dictates the operation to be done by the ALU. It's truth table though describes only 7 operations, which are enlisted in the truth table below. How the processor handles the rest ...
128 views

### How does this reverse NOT gate work?

I created a 74LS181 circuit in Logisim based on TI's datasheet. Notice how the NOT gate for the B0 input has a dot before the triangle: Here's a screenshot of my circuit: Notice that my ...
70 views

### Can a multiplier be used to multiply larger numbers? [closed]

Can you do 8 bit multiplication easily with a 4 bit multiplier. Efficiently.
88 views

### Design an ALU that only adds

I need some help designing a simple ALU that only can add (4-bit) numbers. For the design I can only use 4-bit full adders and 4-bit edge-triggered flip-flops. I am stuck as I do not even know where ...
137 views

### How can z80 uses a 4-bit ALU and return results in a single clock cycle?

According to Ken Sheriff's blog post Z80 ALU is 4-bits wide. If we take a look at page 8 and 9 of Z80 User Guide we will find the following information: Clock states T3 and T4 of a fetch cycle are ...
103 views

### How do I multiplex 6 x 4 bit ALU outputs?

I have an ALU that performs 6 functions, each function provides a 4 bit result. I want to multiplex these outputs so they can be selected with an op-code (selector bits of the mux). The only problem ...
130 views

### AND gate with a single input in a diagram

consider the following diagram: http://ee-classes.usc.edu/ee459/library/datasheets/DM74LS181.pdf ( page 3 ) The first AND gate at the top left of the schematic has only one input! What does this ...
246 views

### How to link ALU to registers, RAM and Clock?

I've designed a basic 4-Bit ALU which computes A+B, A-B, B-A, and a few logic operations. I'm using a mux to determine which output appears at the multiplexer output. This is a basic start to a CPU as ...
99 views

### How do ALU flags communicate with the rest of the computer?

How are ALU flags connected to various parts of a computer? I've just finished building an 8 bit computer in Logisim that can add subtract and compare... and am wondering how I can make it multiply (...
325 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 ...
1k 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 (...
372 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 ...
83 views

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, ...
72 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 ...
128 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 ...
733 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. ...
2k 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 ...
333 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 ...
87 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 ...
229 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 ...
50 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 ...
245 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 ...
159 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 ...
167 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 ...
437 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 ...
188 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 ...
676 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 ...
80 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 ...
172 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 ...
188 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 ...
21k 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: ...
176 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 ...
539 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 ...
676 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 a ...
329 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 ...
654 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 ...
366 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 ...
982 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 ...