Data Types - Binary Flashcards
What base is hexadecimal, denary and binary?
Hexadecimal-16
Denary-10
Binary-2
How do you convert binary to denary?
Draw out grid 128 to 1, and then put the numbers below
How do you convert denary to binary?
Draw out weights (128 to 1 grid) then see if the numbers fit into the largest weight and go down accordingly.
How do you convert hexadecimal to binary?
Split numbers into individual digits/letters (e.g 189 becomes 1, 8 and 9). Then convert these digits into 4 bits blocks of binary.
How do you convert binary to hexadecimal ?
Similar method as hexadecimal to binary. Split the numbers into nibbles (4 bits) then convert into digits or letters depending on the size.
How do you convert hexadecimal to denary?
Either convert to binary then into denary or remember the grid (1 16 and 256…) then split the numbers and times the first by 1 and so on
How do you convert denary to hexadecimal?
Through binary, or write out the weights (table) and figure out how much you can fit into each number. E.g if you are converting 159 you know it doesn’t fit into 256 but it does three times into 16.
What is the sign and maginitude method of showing negative numbers in binary?
If the leftmost bit is a 1, the number is negative as a result, a 0 is positive
What is the two’s compliment from method of showing negative numbers in binary?
The leftmost bit is always negative if the value is a 1 but if it is a 0 the value of bit is 0. This means when the leftmost bit is one, the rest are always positive. A quicker method is to flip all the numbers and add one, however, if the number already starts with a one before flipping, it will still be negative
What are the binary addition rules?
0 + 0 = 1
0 + 1 = 1
1 + 1 = 0, but carry a 1
1 + 1 + 1 = 1, but carry a 1
What happens in binary subtraction?
You can’t take away 0 from 1 so you have to borrow a 1 so the next bit becomes 0 and the current one becomes 2. Then you do 2 -1 which gives you 1.
What is the alternative method to binary subtraction?
You use two’s compliment and if you have 2 negative numbers to minus one and other you can change one to positive and add the numbers instead