Topic 2 - Data Flashcards
What does Binary represent?
It is used to represent data and program instructions in a computer
Why do we use binary?
Computer processors contain billions of transistors. Act as switches and has two states - on and off.
Two states are represented by 1 (on) and 0 (off). These are called binary digits.
What is the Binary system?
Single bit has two states 1 and 0 but combining bits can produce many unique binary patterns.
A group of 4 bits is called a Nibble
A group of 8 bits is called a byte
What happens if you combine bits?
If two bits are used to represent each item of information e.g a colour then there would be four combinations.
Number of items increases by powers of 2
What is place values?
Every digit has a place value. In binary system, place values are increased by powers of 2.
How to convert binary numbers into positive denary whole numbers?
To convert binary into denary (whole number) add the place value headers where there is a 1.
How to convert denary numbers to binary?
You will have one number that you would want to convert:
Using that number, start with msb (most significant bit) and subtract the original number with the msb and if you get answer in a negative, put a 0 there but if you get a positive then put a 1 there. If you put a 1 there, use the new number and repeat the process whilst going down the number line and if you put a 0, use the original number and repeat the process.
What is unsigned representation?
A binary number that can only represent positive numbers
What is a signed integer?
Represent both positive and negative numbers
How to convert a negative denary number to binary using two’s complement?
Work out the positive binary of the given number, flip the bits and add 1 to the least significant bit so at the far right.
How to convert a negative two’s complement binary to denary?
We will be given a binary number, flip all the bits and add 1 to the least significant bit and then work out the denary as normal and Add a negative symbol for the final answer
What are the binary addition rules?
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 carry a 1
1 + 1 + 1 = 1 carry a 1
What is overflow?
It occurs when the result of adding two binary numbers is greater than the number of bits allowed. A 1 is the msb.
What are the two types of binary shift?
Logical shift and arithmetic shift
What is a logical shift?
Moves all of the bits in a given binary number either to the left or the right by a given number of places. All the empty spaces are filled with 0’s
What is a arithmetic shift?
A left arithmetic shift is identical to a left logical shift. A left shift multiplies the number by 2^n (n = number of places shifted).
A right arithmetic shift moves each bit right one place. The rightmost bit is discarded and the leftmost bit is filled with original bit.
What are the advantages if using hexadecimal?
They are easier to read and remember than binary.
What are the uses of hexadecimal?
Used in:
- Colour values in photo editing software and HTML
- MAC addresses
- Memory address locations in assembly language
What is ASCII?
Text and characters are represented by the ASCII code which stands for American Standard Code for Information Interchange. It is a 7-bit code.