Chapter 1: Data Representation Flashcards
How and why computers use binary to represent data
the binary number system is chosen because because it only consists of ones and zeros
What is binary
Binary is a bunch of ones and zeros effectively switches which have two positions : on and off
How to convert to binary to denary
Each time one value appears in a binary number column e.g 128 64 32 16 8 4 2 1. The column value is added to a total.
converting denary to binary
Subtraction of power of two e.g. 142 - 128 = 14
14 - 8 = 6
6 - 4 = 2
2 - 2 = 0
1 0 0 0 1 1 1 0
Why is hexadecimal number system used?
Easier for humans to remember and work with, since a hex digit represent four binary digits
Examples of using hexadecimal system
- Error codes
- Media Access Control (MAC) Addresses
- Internet Protocol (IP) Address
- HTML colour codes
How to add two positive 8 bit numbers
Carry and sum method.
What are logical binary shifts on positive 8-bit integers?
The logical shift means moving the binary number to the left or to the right.
- Each shift left is equivalent to multiplying the binary number by 2.
- Each shift right is equivalent to dividing the binary number by 2.
What is two’s complement?
A way of representing negative integers in binary.
A 1-value in the left-most bit (ie. -128) indicates a negative number and a 0-value in the leftmost bit indicates a positive number
Convert kilobyte, megabyte, gigabyte, terabyte and petabyte to bits
1 GB is equal to ………. MB
1024 MB
what are the uses of binary
Used to represent transistor states in computers
used to represent numbers in digital displays
used in CPU registers
file formats examples
MIDI(music)
JPEG(image)
MP3(Sound)
MP4(video)
Lossy vs lossless
lossless- restores and rebuilds file data in its original form
Lossy - the file has been slightly compressed which saves space
Parity check
even parity - must be an even amount of ones
odd parity - must be an odd amount of ones