Project0 Getting Started-Mux8Way16 (x89ab = -30293 decimal?)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Project0 Getting Started-Mux8Way16 (x89ab = -30293 decimal?)

jamos
Hi everyone

Im going through the book as a self study and Im just wondering why the value of 89ab hex is -30293 decimal on the h pin  when I load up the Mux8Way16.hdl and Mux8Way16.tst, I am clearly misunderstanding some fundamental mathematics here and was hoping someone could help before I move on....

many thanks
J
Reply | Threaded
Open this post in threaded view
|

Re: Project0 Getting Started-Mux8Way16 (x89ab = -30293 decimal?)

ybakos
Sounds like you need to familiarize yourself w/ the 2's complement system. The most thorough and approachable explanation that I like is Petzold's CODE, chapters 12 & 13. You'll get the most out of this if you read chapters 1 - 13.
Reply | Threaded
Open this post in threaded view
|

Re: Project0 Getting Started-Mux8Way16 (x89ab = -30293 decimal?)

cadet1620
Administrator
In reply to this post by jamos
jamos wrote
Hi everyone

Im going through the book as a self study and Im just wondering why the value of 89ab hex is -30293 decimal on the h pin  when I load up the Mux8Way16.hdl and Mux8Way16.tst, I am clearly misunderstanding some fundamental mathematics here and was hoping someone could help before I move on....

many thanks
J
Negative numbers are stored in binary in two's compliment format.  This will be explained in detail in TECS chapter 2.  Briefly, the most significant bit of the number is used as a sign bit to indicate negative numbers.  Any hexadecimal number beginning with 8-F is a negative number.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Project0 Getting Started-Mux8Way16 (x89ab = -30293 decimal?)

jamos
In reply to this post by jamos
thanks guys, its a totally foreign concept and at least I know what to read about now