1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
binary number system
uses 2 as the radix
employs two binary digits: 0 and 1
can rep any number using the positional notation
the MOST SIGNIFICANT BIT (MSB) is the leftmost bit of a binary number
the LEAST SIGNIFICANT BIT (LSB) is the rightmost bit of a binary number
radix
the “base” of the number system (ex: for binary, the radix = 2)
positional notation
see “Summary of Chapter 3” notes, page 1
converting from decimal to binary (fractional part and the whole number part)
see “Summary of Chapter 3” notes, page 1, 2
convert from decimal to hexadecimal
same process as converting decimal to binary except you keep dividing by 16 instead of 2
see “Summary of Chapter 3” notes, page 1
convert from decimal to octadecimal
same process as converting decimal to binary except you keep dividing by 8 instead of 2
see “Summary of Chapter 3” notes, page 1
converting from hexadecimal to binary (& vice versa)
see “Summary of Chapter 3” notes, page 2
converting from octadecimal to binary (& vice versa)
see “Summary of Chapter 3” notes, page 3
two ways to represent binary numbers
unsigned numbers → always non-negative (>= 0)
signed numbers → can be either negative or non-negative and it’s indicated by the SIGN BIT (the MSB) where 0 = non-negative num and 1 = negative num
domain of UNSIGNED binary numbers
[0, (2^n) - 1] with n = max number of bits
EX. if max num of bits (n) = 4, then the domain is 0 to (2^4)-1 (0 to 15) and overflow occurs when the result of an operation (such as addition) is outside of that domain.
complements
in digital computers, complements are mainly used to rep neg nums
there are 2 types of complements for each base r system:
(r - 1)’s comp
r’s comp
for instance, for base 2 (the binary sys), there are 2’s comp and 1’s comp representation
to find the 2’s complement and 1’s complement of a binary num
see “Summary of Chapter 3” notes, page 4
how to detect overflow when adding signed bits
when performing addition of two non-negative numbers, the result has a sign bit of 1 (1 = neg num, which wouldn’t make sense)
when performing addition of two negative nums, the result has a sign bit of 0 (0 = non-neg num, which wouldn’t make sense since neg + neg cannot equal a pos num)
if the operands have the same sign bit, then the expression [MSB of the result] xor [next-MSB of the result] determines whether you had overflow
if the operands have diff sign bits, then use the expression [carry-in of the MSB of the result] xor [carry-out of the MSB of the result]
BCD
binary bits are in groups of 4
ex. 0010 = 2
floating point representation
see “ Summary of Chapter 3” notes, page 5
converting a decimal num to a binary num in floating point rep
see '“Summary of Chapter 3” page 6
converting a binary num in floating point rep to a decimal num
see “Summary of Chapter 3” page 7
IEEE 754 standard for representing floating point numbers
see “Summary of Chapter 3” page 5
the rule for the exponent part of a floating point num (32 bits)
e - 127 = exp
where:
e = the number expressed in binary in the register reserved for the exponent
exp = the actual exponent