Data Representation Flashcards
(68 cards)
What is the smallest possible unit in a computer?
A bit
What is a byte?
8 bits grouped together
How does binary conversions work?
Each digit to the left doubles/increases by a power of 2 ; if the number is a 0 then u ignore and if its a 1 u add that value
What are the 4 rules of binary addition?
- 0+0=1
- 1+0=1
- 1+1=0, with a carry of 1
- 1+1+1=1, with a carry of 1
What is the MSB?
The most significant bit: largest value column (furthest left)
What is the LSB?
The least significant bit: the smallest value column (furthest right)
What is the MSB used for?
To represent whether the number is positive or negative ; if a binary begins with 1, then its negative, if 0 then positive (look on flashcard 7)
What are fixed point binary numbers?
A specified number of bits before and after the binary point
How do the numbers work after the binary point?
Negative power of 2/halves in size
What are the differences between fixed-point and floating-point binary numbers?
-It’s faster to process calculations using fixed-point numbers compared to floating-point numbers (this means that floating-point numbers are best suited to situations where you need to represent a wide range of values)
-Fixed-point is best suited when speed of processing is more important than precision
What is an underflow error?
Occurs when result is too small for the register to hold [opposite of overflow]
[Dividing a very small number by a large one will make a number so small that it could be stored as 0]
Why do computers round some number?
Because some numbers cannot be represented using the number of bits allocated to them eg 2.7, in this case the number is rounded to the nearest representable number
What are the 2 different methods of measuring the precision of a rounded value?
Absolute error and relative error
What is absolute error?
The difference between the rounded number and the actual number {basically how far off you are from the actual number eg 5.2 [rounded], 5(actual); absolute error= 0.2}
What is relative error?
The proportion/percentage of how far off you are from the actual number
To calculate, you take the absolute error and then divide by actual number, then multiply by 100
How many unsigned binary integers can be represented using n bits?
2^n will give you no. of integers
2^n-1 will give you highest number that can be stored
eg 7 bits? 2^7 integers can be represented
2^7-1 = 127 highest number than can be stored
What are the 4 main techniques for detecting errors?
- Parity bits
- Majority vote
- Checksum
- Checkdigit
What is a parity bit?
A parity bit is a single bit added to a string of binary code which indicates whether the number of 1s in the string is even or odd
Even Parity: The parity bit is set so that the total number of 1s in the string, including the parity bit, is even.
Odd Parity: The parity bit is set so that the total number of 1s in the string, including the parity bit, is odd
What is majority vote?
When each bit sent 3 times; the bit that occurs the most is kept as the valid value in the bit pattern
[inefficient as it sends triple the data needed]
What is checksum?
A hash of data within a packet; the checksum is sent along with the packet
When the packet is received the checksum is recalculated and if they match then the data has been received correctly. If they don’t then an error has occurred
What is a checkdigit?
Added to the end of the number that is calculated by using the rest of the digits
[used coz its common for human error to occur during entry of long code eg customer numbers/receipts, usually MOD11 method]
NOTE
Parity bits, checksums and checkdigits detect errors but cant correct them
What are natural numbers and what is its notation?
A positive whole number used for counting eg 0,1,2,3, ‘100 students at an event’
Notation: N
What is the notation of integers?
Notation: Z
however, by definition it also includes all of N