`

基本概念与原理(一)

阅读更多

1.MSB:Most Significant Bit      LSB:Least Significant Bit

2.Two's-Complement:a mathematic principle that the two's complement of an interger is its additive inverse

 Usage:Notation of negative integers

 Example:Suppose we're working with 8 bit quantities (for simplicity's sake) and suppose we want to find how -28 would be expressed in two's complement notation. First we write out 28 in binary form.

 

00011100

 

Then we invert the digits. 0 becomes 1, 1 becomes 0.

 

11100011

 

Then we add 1.

 

11100100

 

That is how one would write -28 in 8 bit binary.

Reason for this is that it is useful to processor designers because it removes the need for separate digital circuits to handle both addition and subtraction.For example:A-B equivalent A+(-B)

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics