ALU status register carry equation

Click For Summary
The discussion focuses on the carry (C) equation in an ALU status register, with initial confusion about whether C equals the last carry output or a combination of the last bit and the last carry output. Clarification indicates that the carry is relevant primarily during arithmetic operations, where it reflects the overflow from the addition process. An example illustrates that in an 8-bit ALU, a carry occurs when the result exceeds the maximum representable value, such as in the addition of 1100 0000 and 0110 0000, resulting in a carry of 1. The conversation emphasizes that the carry's behavior can vary depending on the specific ALU design and its operations. Understanding the carry mechanism is crucial for accurate arithmetic processing in ALUs.
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,082
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.
 
Thread 'I thought it was only Amazon that sold unsafe junk'
I grabbed an under cabinet LED light today at a big box store. Nothing special. 18 inches in length and made to plug several lights together. Here is a pic of the power cord: The drawing on the box led me to believe that it would accept a standard IEC cord which surprised me. But it's a variation of it. I didn't try it, but I would assume you could plug a standard IEC cord into this and have a double male cord AKA suicide cord. And to boot, it's likely going to reverse the hot and...

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
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
9
Views
36K