105 Flashcards
What is the decimal number system?
> Base 10 system
> Maximum number value that can be stored goes up by the equation 10^n - 1
What is the binary number system?
> Base 2 system
> The max value that can be stored goes up by the equation 2^n - 1
How are binary numbers grouped?
> In groups of 4
> Leading 0’s are added
What is a 4 bit group called?
A nibble
What is an 8 bit group called?
Byte
What is the hexadecimal number system?
> Base 16 system
Symbols 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
A-F represents 10-15
The max number that can be stored goes by the equation: 16^n - 1
Why is hexadecimal useful when compared to binary?
Each nibble can be represented by a single hexadecimal digit
How are hexadecimal often notated?
> This a 0x at the front
How are decimal numbers converted to binary?
> Construct the decimal number by summing powers of 2
> 97 = (2^6) + (2^5) + (2^0)
How are binary numbers converted to hexadecimal?
Split the binary number into nibbles and convert each nibble into a corresponding hexadecimal number
How are hexadecimal numbers converted to binary?
Convert each hexadecimal digit into the equivalent nibble
How are decimal number converted to hexadecimal?
> Construct the decimal number by summing multiples of powers of 16 > 3740 = 14(16^2) + 9(2^1) + 12(2^0) = 0xE9C # 3740/16^2 = 14 remainder 156 # 156/16^1 = 9 remainder 12 # 12/16^0 = 12 # so 0xE9C
What is a signed number?
> A way of writing negative numbers in binary
Positive integers are unsigned integers
Negative integers are signed integers
What are the 3 ways of displaying negative numbers?
> Sign-magnitude format
1’s Complement format
2’s Complement format
What is sign-magnitude format?
> Most significant bit is used to represent the sign
0 represents positive numbers
1 represents negative numbers
The remaining bits represent the number
What is the problem with sign-magnitude format?
> There are 2 ways of representing 0
0000
1000
What is the range of sign-magnitude format?
-2^(n-1) + 1 ≤ x ≤ 2^(n-1) - 1
What is 1’s compliment?
> Positive numbers are represented normally
> Negative number are represented as the inverse (1’s become 0 and 0’s become 1)
What is the problem with 1’s complement?
> There are 2 ways of representing 0
0000
1111
What is 2’s complement?
> This is a method of representing positive and negative numbers without there being 2 numbers for 0
What is the range of 1’s complement?
-2^(n-1) + 1 ≤ x ≤ 2^(n-1) - 1
> Same as sign-change
How does 2’s complement work?
> The most significant bit is treated as negative and the rest is calculated like normal.
What are the parallels between 1’s and 2’s complement?
> 2’s Complement is the same as 1’s Complement except 1 has been added to the number
What is the range of 2’s complement?
> It is 1 decimal number larger than 1’s complement because there is only one representation of 0 (0000)
-2^(n-1) ≤ x ≤ 2^(n-1) - 1
What are the 4 basic rules for adder circuits?
> 0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 carry 1 = 10
What is a half adder? What is the circuit?
> This is a circuit that sums 2 bits
An XOR gate for the sum bit in parallel with…
An AND gate for the carry bit
What happens when you have multiple bits to be added in a half adder system?
The carry bit is then fed into the next adder which has 3 input gates
What is a full adder?
> This takes into consideration the carry bit into the addition of 2 bits.
Multiple full adders can be strung together to add multiple bits
What are the 2 boolean expressions for a full adder?
> sum= A⨁B⨁Ci
> Co=A.B+Ci.(A⨁B)
What is it called when multiple full adders are joined together?
A ripple adder
Do ripple adders work for all signed numbers?
> No
> Just 2’s complement
How can a ripple adder work with 2’s complement?
As long as the final carry bit is ignored