How Data is Held Flashcards
Binary and Character codes
What is Binary?
A base 2 number system represented through the digits 1 and 0.
How is Binary stored in the Computer?
All data is held using on/ off signals
Why is Binary Used in computers?
Computer systems are based on switches, which can only have two states, on or off. Binary numbers use two digits. Binary is high tolerance and robust.
What Are Bits?
one binary digit 1 or 0
What is a Byte?
a group of 8 bits
What is a Nibble?
a group of 4 bits
List the place values of a byte in descending order
128, 64, 32, 16, 8, 4, 2, 1
How to convert Binary to Denary
Add up the values of all place values where there is a 1
How to convert Denary to Binary
Subtract place values from the denary starting with the highest. When you do this, put a 1 in that place value
What is Hexadecimal
A base 16 number system. The digits 0-9 are the same as denary, while the digits 10-15 are A-F alphabetically.
Why is Hexadecimal used
-easy to convert to and from binary
-easier to understand than binary
How to Convert Denary to Hexadecimal
divide the denary number by 16. The quotient goes in the 16s column, the remainder goes in the 1s column.
How to Convert Binary to Hexadecimal
Split the number into nibbles and write the matching hexa number under each group of 4.
How to convert Hexadecimal to Binary
Write 4 bits under each hexa digit
What is ASCII
A character set that represents each keyboard character (265 charas) as 8- bit binary codes.
What is Unicode
An extended character code sequence. Old ascii files can still be read with unicode.The first 8 bits of unicode are the same as ascii, but it used 16-32 bits so needs more storage space.
What is included in Unicode
- All global alphabets including braille.
- Currency, maths, map, and musical symbols
- Ancient languages eg. hieroglyphics
- Codes for emojis and other pictures
- Control and Formatting signs
Who controls unicode
- the unicode consortium
- if you invent a new emoji or code you want to be used, you have to submit it to them . If they agree they will give it a code.
How do different processors interpret unicode
Every make of computer / phone may interpret unicode characters slightly differently , eg apple vs android emojis look different.
1)how to find the unicode for any character in python
2) how to find the character for any code number in python
(using the example c)
1) ord(“c”)
2) chr(67)
how are negative binary numbers stored with sign and magnitude
the most significant bit stores the sign ( 0 for + , 1 for - )
how are negative binary numbers stored with two’s compliment
The most signigicant bit is a negative value and the rest are positive
what advantage does two’s compliment have over sign and magnitude
it can be used in calculations, whereas sign and magnitude can’t.
how to convert a positive binary number to a negative using two’s compliment
flip all the bits, then increment the least significant bit