Questions tagged [alu]

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

188 questions
0
votes
1 answer

Chapter 2 ALU.hdl not working on final line

When I run ALU-nostat.tst, the code executes perfectly. However, when I run ALU.tst, the code stops on line 1. If I then click the forward arrow again and allow it to test out the following test cases, it seems to work. I compared the output file…
0
votes
1 answer

Changing,deleting or adding something to the ALU mic-1 architecture

Hey im struggling with a Task. Anyone here to help me to solve this question? Consider the appearance of the Mic-1 and discuss the following changes. Go For example, ask whether the micro-architecture is still fundamentally working and which…
0
votes
2 answers

Issues in compact 1-bit ALU behavior

I tried to write a compact code for a 1-bit ALU that implements logic operations, a full adder, and a full subtractor. The compilation looks fine, but it does not assert the message "Test done." at the end of the testbench. Moreover, the change of…
欲しい未来
  • 121
  • 1
  • 9
0
votes
2 answers

ALU Design - Should a left shift cause overflow for signed numbers?

My understanding is an overflow can happen when all of the following conditions are met: Performing addition or subtraction. Both numbers should have the same sign. The result should have the opposite sign. Ex: for 4-bit numbers 410 + 510 = 01002…
Plasty Grove
  • 2,807
  • 5
  • 31
  • 42
0
votes
0 answers

which data are loaded and not into register before execution?

Before a certain operation is to be performed on the data by ALU, Will the operands have to be loaded into the register from memory to perform? If yes, then why address field in the instruction may refer to the memory address of the operand?
0
votes
1 answer

Issue with an 8-bit ALU: the program won't stop and I need to verify that the specifications are reached

I have a big issue with an 8-bit ALU. To begin with, the code won't stop running. Second, a chart of specifications was given, and I believe I'm missing some of them Here are the specifications: Specification Data Inputs: A (8-bit), B…
GHG HGH
  • 37
  • 3
0
votes
0 answers

How are control signals known when the fetch cycle differs across instructions?

If the first cycle of each instruction is not the same (ie not all instructions have the same fetch cycle), then how does the processor know what the control signals should be for the first cycle? I understand that usually the fetch cycle is the…
0
votes
0 answers

I don't know what to write on the time intervals of the VHDL testbench

I am writing two VHDL codes; one for an ALU and another one for a two-port data memory. After some useful recommendations from contibutors here in Stack Overflow, I have managed to come up with the following VHDL codes for an ALU and a two-port data…
xxs899
  • 5
  • 5
0
votes
0 answers

Accumulator - Read and Write simultaneously

I have a quite stupid question about the accumulator, which I read is often made out of D-Flip-Flops, and the ALU. I don't get how the Accumulator can be one of the inputs for the ALU, but at the same time the location for the result. If the next…
0
votes
1 answer

Rotations Operations for 16bit ALU using multiplexers (updated question)

I'm new to this topic, with less knowledge about the coding part of it. But is there a way to implement multiple bit rotate operations using multiplexers for 16bit ALU ? I know the understanding, but not the coding part in iVerilog. I did barrel…
aLIEz
  • 29
  • 5
0
votes
1 answer

ALU 32 BIT, Overflow, Zero Flag

This ALU can perform addition, subtraction, AND, OR on the two data inputs according to an operation code supplied to the ALU. The two-bit control input named Operation partially specifies the operation code. I have been trying to work it but always…
0
votes
0 answers

VHDL : Internal signals are undefined even when defined in the architecture declaration section

So I've been working on some homework for my VHDL course and I can't seem to understand this problem. The point here is to create the adder/subtractor of an ALU that works both on 2's complement and unsigned 32-bit buses, which is why I have a…
0
votes
0 answers

Getting dependence types of RAW, WAR, WAW from instruction numbers

I have this question which asks me to find the dependence types RAW, WAR, WAW, based on these instruction numbers, and I have the answer in the table, but I can't remember how to arrive at this answer. I want to know how to arrive at that table…
Alex
  • 15
  • 6
0
votes
1 answer

Add instruction greater than immediate to MIPS

This is a homework question and i am stuck because i dont know how to evaluate if a value is greater than another. Here is the instruction i need to add: The sgti instruction - set on greater than immediate - is an instruction which allows setting a…
Lynn
  • 121
  • 8
  • 25
0
votes
2 answers

Not getting the relevant output in my 32-bit ALU using gate-level verilog code

Below is the code for 32 bit ALU with 3 different modules with their individual codes as well. I am not getting any warning now but I am also not getting the expected 32-bit output as shown in the figure below. No changes can be made in the stimulus…
Sunny Parekh
  • 945
  • 7
  • 17