AS Level >Basics Binary and Hex< |
Basics Binary and Hex |
|
Binary is the base 2 number system counting 0, 1, 10, 11, 100, 101, 110, 111, 1000, etc.
Thanks xkcd
These are used in everyday life and are so familiar that many important features get forgotten.
One binary digit. A zero or a one.
A group of eight bits. Computer data is usually stored and processed in bytes or pairs of bytes or even groups of four or eight bytes.
This is half a byte or four bits. The word was originally a joke but the term proved useful.
In an eight bit byte such as 11100111, the HIGH nybble is 1110 and the LOW nybble is 0111.
They are called low and high because the low nybble is worth 0 to 15 in decimal numbers and the high nybble allows numbers up to 255.
Nybble is often spelled nibble. Internet flame wars rage over this!
Grouped bytes are called words. 64 bit computers common in 2015 work with 8 byte groups. 8 x 8 = 64 bits in the word.
In this number: 11100111 the
Getting bits back to front causes serious errors so it's important to pay attention to this.
This mistake crops up frequently when designing binary counters to reset on specific numbers like ten.
Decimal | Binary |
8 4 2 1 | |
0 | 0 0 0 0 |
1 | 0 0 0 1 |
2 | 0 0 1 0 |
3 | 0 0 1 1 |
4 | 0 1 0 0 |
5 | 0 1 0 1 |
6 | 0 1 1 0 |
7 | 0 1 1 1 |
8 | 1 0 0 0 |
9 | 1 0 0 1 |
10 | 1 0 1 0 |
11 | 1 0 1 1 |
12 | 1 1 0 0 |
13 | 1 1 0 1 |
14 | 1 1 1 0 |
15 | 1 1 1 1 |
Decimal | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
Binary | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | |
Yes/No | 0 | 0 | 32 | 16 | 0 | 0 | 0 | 1 | Total = 49 |
A 64 bit computer could put the most significant byte at the left or right end of the group of eight bytes. Different computer manufacturers use both schemes. This makes it more difficult to store and transfer data between incompatible systems. Data munging is needed to reverse the byte order. Internet flame wars rage over this topic.
It does not take long to jot down this table. Then you can just look up the binary/hexadecimal conversions
Decimal | Binary |
8 4 2 1 | |
0 | 0 0 0 0 |
1 | 0 0 0 1 |
2 | 0 0 1 0 |
3 | 0 0 1 1 |
4 | 0 1 0 0 |
5 | 0 1 0 1 |
6 | 0 1 1 0 |
7 | 0 1 1 1 |
8 | 1 0 0 0 |
9 | 1 0 0 1 |
A | 1 0 1 0 |
B | 1 0 1 1 |
C | 1 1 0 0 |
D | 1 1 0 1 |
E | 1 1 1 0 |
F | 1 1 1 1 |
0011 | 0010 | 1001 | 1100 |
3 | 2 | 9 | C |
Here are some examples of hexadecimal numbers ...
0x3F9C | This notation is used by AQA, Microsoft Windows, C, C++, C# and Java programmers. |
&H3F9C | This notation is used by BASIC programmers |
$3F9C | This notation is used by Pascal programmers |
3F9C16 | This is how hexadecimal numbers are written in printed text. |
What is the biggest number that can be stored in a six bit memory location? | 26 - 1 = 63 |
If each pixel uses 24 bits to store the colour, how many colours are there? | 224 = 16.7 Million |
A computer has a 20 bit address bus. How many addresses can it access? | 220 = 1 Million |
A digital to analogue converter uses 8 bits. How many levels are available for the digitised signal? | 28 = 256 |
A microcontroller has a 14 bit word. 8 bits are used for data and six for instruction op-codes. How many op-codes could be available? | 26 = 64 |
How many colours are available if four but colour is being used? | 24 = 16 |
What is the biggest number that can be stored in a four bit latch? | 24 - 1 = 15 |
Monochrome displays use black and white. How many bits are needed to store each pixel? | 21 = 2 so only one bit is needed. |
Subject Name Level Topic Name Question Heading First Name Last Name Class ID User ID
Q: qNum of last_q Q ID: Question ID Score: num correct/num attempts Date Done
|
Question Text
image url
Help Link
Add Delete Clone Edit Hardness
Contact, Copyright, Cookies and Legalities: C Neil Bauers - reviseOmatic V4 - © 2016/17
Hosted at linode.com - London
Please report website problems to Neil