What does negative accumulator after addition means?

Thread Starter

terabaaphoonmein

Joined Jul 19, 2020
111
Say I do an add instruction.
Then, the accumulator becomes negative.
What does that mean? Is that invalid?

Context-:
I am studying symbolic microprogram from Morris Mano's COA book.
On page 229 of his book, he mentions an interesting and confusing thing.

BRANCH instxn should cause a branch to effective address if AC<0(AC<0 when S=1, i know this).

this should cause a branch to effective address(address of operand i guess, but which operands?)

and if S=0, no branch occurs

Reference Figures-:
ask ECE 5.PNG
ask ECE 5.PNGfigure reference.PNG
 

Deleted member 115935

Joined Dec 31, 1969
0
Think binary.
specificaly 2's compliment, which is what you chip is running

if you have an accumulator of a set number of bit, lets say 3

we assign 001 as being '1' in base 10
010 as being '2 in base 10.

we keep adding, and we get to 011 , which in base 10 is 3

now what happens when you add 1 ?

you get 100, which if you look at that as 2's compliment is -4.

Add one more to that,
101 , which in 2's compliment is -3, as expected,

https://en.wikipedia.org/wiki/Two's_complement
 

Thread Starter

terabaaphoonmein

Joined Jul 19, 2020
111
Think binary.
specificaly 2's compliment, which is what you chip is running

if you have an accumulator of a set number of bit, lets say 3

we assign 001 as being '1' in base 10
010 as being '2 in base 10.

we keep adding, and we get to 011 , which in base 10 is 3

now what happens when you add 1 ?

you get 100, which if you look at that as 2's compliment is -4.

Add one more to that,
101 , which in 2's compliment is -3, as expected,

https://en.wikipedia.org/wiki/Two's_complement
I understand about 2's complement and theory of negative numbers.
My question where i am still stuck is "why do this branch instruction only branches when AC<0?"
 

Papabravo

Joined Feb 24, 2006
21,225
I understand about 2's complement and theory of negative numbers.
My question where i am still stuck is "why do this branch instruction only branches when AC<0?"
If the instruction set only has room for one branch instruction, then you have to pick one. It is all you need since it is a binary choice, You could just have well picked an instruction that branched when AC was ≥ 0 The net result would be the same. We used to write algorithms all the time using negative indexes that quit when you reached 0 or not-negative.
 

Thread Starter

terabaaphoonmein

Joined Jul 19, 2020
111
Thanks.So, I can safely assume that I can choose whatever condition and it is not sth fixed(like only AC<0). I am too much confused in this topic, and there are very few good books. Really feeling frustrated, any resources helps will be helpful enough.
 

Papabravo

Joined Feb 24, 2006
21,225
Thanks.So, I can safely assume that I can choose whatever condition and it is not sth fixed(like only AC<0). I am too much confused in this topic, and there are very few good books. Really feeling frustrated, any resources helps will be helpful enough.
So anytime you have a two way branch in an instruction stream you can always arrange things so that if you use the complementary instruction you can rearrange the instructions stream to work either way. You can even - if you wish - put a jump instruction following the branch instruction so that you can invert the two destinations if you use the complementary condition.
 
Top