Questions tagged [alu]

ALU stands for Arithmetic Logic Unit, that performs arithmetic and logical operations for computer systems.

188 questions
-2
votes
1 answer

How to declare inputs and outputs when it's opposite for different modules in a processor in verilog?

module alucontrol(iw,cntrl,Ra,Rb,Wa); input [14:0]iw; output reg [3:0]cntrl; output reg [3:0]Ra; output reg [3:0]Rb; output reg [3:0]Wa; always@(*) begin cntrl=iw[14:12]; …
-2
votes
1 answer

4-bit ALU using VHDL showing error: no function declarations for operator "+" ("-", "*",and "/")

When I compile this code using ghdl it produces errors. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity alu is generic ( constant N: natural := 1 ); port( a,b : in std_logic_vector(3 downto 0); …
-2
votes
1 answer

Can't understand Mips, ALU, Clock Cycle Related Solution

I am reviewing test that I got on midterm before, but the provided solution doesn't explain for question below... Here is question: Question 11. Assume that the multiplier hardware on your MIPS processor is set up like the multiplier discussed last…
online.0227
  • 640
  • 4
  • 15
  • 29
-2
votes
1 answer

Arithmetic and Logic circuit Design

Suppose, we want to design an arithmetic and logic unit (ALU) so that it performs the following operations: Say, Two inputs are A and B. cin represents carry in. s2,s1 and s0 are selection variables such that: s2/cin s1 s0 Function 0 …
user4650623
  • 17
  • 2
  • 11
-2
votes
1 answer

8 Bit ALU with Overflow in Verilog

Create a Verilog module called eightbit palu which has two 8-bit inputs, a and b, and one 2-bit input, sel. The outputs of this module are an 8-bit signal f, and a 1-bit signal ovf. The value of these outputs should change based on the sel signal…
smd
  • 55
  • 1
  • 3
  • 9
-3
votes
1 answer

How to add binary that is unsigned char type in C?

Here is the sheet that I need to follow https://i.stack.imgur.com/lsu70.jpg Here is my code as of now #include #include #include #include void arithmetic(); int ALU(unsigned char operand1, unsigned char…
wait what
  • 3
  • 4
-3
votes
2 answers

Verilog Design of a 32-bit ALU

Can you help me guys do a 32-bit ALU and explain me some things? Wanna do: 0 bitwise AND: out = inA & inB. 1 bitwise OR: out = inA | inB. 2 addition: out = inA + inB. 6 subtraction: out = inA – inB //2's complement 7 Set On Less Than: out = ((inA <…
1 2 3
12
13