week2 Binary Representation Flashcards
What is a bit
a basic unit of information in a computer. Also called a binary digit.
What is a nibble?
4 bits
what is a byte?
8 bits
what is a digital
finite number of symbols.
what is the weighted positional representation?
Each digit in the representation is weighted according to its position in the number.
Unsigned numbers
positive numbers and 0
signed numbers
negative numbers, 0, positive numbers
Width
the number of bits a computer can use to hold a number
Unsigned overflow
when an operation result goes beyond the width of memory location in a computer.
signed overflow
when you add 2 positive numbers and get a negative result within the given computer’s width.
OR
if you add 2 negative numbers and get a positive result.
sign extension
when performing arithmetic operations on numbers of different width, we must sign extend numbers.
sign extend numbers mean replicating the sign but 0 or 1 before the number of smaller width before performing operations so that both numbers are the same width.
Encoding data means
an agreed upon “mapping” of data from one representation to another
How to find positive and negative integers in sign-magnitude.
need to place 1 in front of a number for a negative integer.
EX:
0001 = + 1
1001 = -1
**leading number indicates the sign of the number.
How to find positive and negative integers in 1C
TO find the negative numbers, flip the the positive representation of a binary numbers to complement each bit.
EX:
0101 = +5
1010 = -5
How to find positive and negative integers in 2C?
To find the negative integer: 1C + 1 and omit any resulting carry-out past the width of the machine.
EX:
+5 = 0101 in 2C
-5 = 0101 + 1 = 1011