ALU status register carry equation

Click For Summary

Discussion Overview

The discussion revolves around the carry equation for the logic gates in an ALU status register, particularly focusing on how the carry (C) is determined during arithmetic operations. Participants explore different interpretations of the carry output and its dependency on previous operations.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant initially proposes that the carry (C) is simply the last carry output.
  • Another participant suggests that the carry should be defined as the sum of the last bit primed AND the last carry output, questioning the initial claim.
  • Some participants express uncertainty about how the carry is set when the ALU performs logical operations like OR and AND, indicating that it may not make sense to use the carry bit from these operations.
  • A participant seeks clarification on how the carry can depend on a previous operation, asking for an example of Assembly code and a specific ALU to illustrate the point.
  • Another participant provides an example of how carry is treated in an 8-bit ALU, explaining that the carry is the next bit after the largest bit the ALU can handle.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct definition of the carry equation, and multiple competing views remain regarding its dependency on previous operations and the context of arithmetic versus logical operations.

Contextual Notes

There are limitations in the discussion regarding the assumptions made about the ALU's design and operation, as well as the specific context in which the carry is being evaluated. The discussion does not resolve the mathematical steps involved in determining the carry output.

garr6120
Messages
42
Reaction score
0
I was wondering what the carry (C) equation for the logic gates would be in an ALU status register?

I originally thought that it was C equals the last carry output. However, my colleagues tell me its C equals to the sum of the last bit primed AND the last carry output.

Can someone clarify my misconception if I am wrong?
 
Engineering news on Phys.org
You mean how carry is set if the ALU performs OR, AND or similar operations? It will depend on the ALU, I don't think it makes sense to use the carry bit from these operations.
 
mfb said:
You mean how carry is set if the ALU performs OR, AND or similar operations? It will depend on the ALU, I don't think it makes sense to use the carry bit from these operations.
I mean when the ALU uses arithmetic sorry.
 
garr6120 said:
I originally thought that it was C equals the last carry output. However, my colleagues tell me its C equals to the sum of the last bit primed AND the last carry output.
What does this mean? You get a potential carry output bit set if the result of the add generates an overflow/carry in the target register. How can it be dependent on a previous operation?

Can you give an example of the Assembly code you have in mind, and mention a potential ALU that we can use to answer the question?
 
For example...

http://www.learnabout-electronics.org/Digital/images/ALU-logisim.gif
ALU-logisim.gif
 

Attachments

  • ALU-logisim.gif
    ALU-logisim.gif
    45.2 KB · Views: 1,101
garr6120 said:
I mean when the ALU uses arithmetic sorry.
There, carry is simply the next bit after the largest bit the ALU regularly has. If you want to add 1100 0000 + 0110 0000 the result is 1 0010 0000, but an 8-bit ALU can only show 0010 0000, the remaining bit is treated as carry.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
Replies
9
Views
36K