??? 03/21/05 18:40 Read: times |
#90177 - Carry Bits Responding to: ???'s previous message |
Hi Daniel,
I don't know your level of knowledge, so I'm not sure if this is what you're asking. Nonetheless, this is about carry bits in general. A carry bit is an extra bit in a register. It is set when the register is overflowed (which is to say when the maximum value the register can hold is exceeded). In other words, if you have a four bit register with a carry bit (like maybe a 74XX?93 if my memory serves), and you start incrementing the value in the register, the sequence would look like this Value Register Carry 0 0000 0 . . . . . . . . . 13 1101 0 14 1110 0 15 1111 0 16 0000 1 If you were cascading two 93s together to make an 8 bit ripple counter you would use the carry bit of the first to increment the second. When you add numbers with pencil and paper, you have to "carry" values from one column to the next, this is the function (and the etymology of the name) of the carry bit. Now with regard to the 8051, the carry bit is associated with the accumulator and in general is set anytime an arithmetic operation results in an overflow of the accumulator. Actually, I find myself uncertain if there are any op-codes that let you perform arithmetic functions on any other registers directly (which might also affect the carry bit if true), but I don't believe there are. So as always, read the "Bible" (which brings me directly to my final point). If this is more elementary than the information you were looking for, then I apologize. In any case, you still need to do as Erik and Andy suggest. Read the "Bible" and learn which instructions can affect the carry bit, and which instructions are affected by it. |
Topic | Author | Date |
Carry flag (CY) - how do it work? | 01/01/70 00:00 | |
very well described | 01/01/70 00:00 | |
carry flag | 01/01/70 00:00 | |
search | 01/01/70 00:00 | |
Irrelevant! | 01/01/70 00:00 | |
Carry Bits | 01/01/70 00:00 | |
there are | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
Thanx![]() | 01/01/70 00:00 |