1.1 Number Systems
Any form of data needs to be converted to binary to be processed by a computer.
Denary+Binary+Hexadecimals
- Binary system :
- Base 2.
- Only has 2 values
- Represented using 0 and 1
- Denary system:
- Base 10.
- Has 10 values
- Represented with numbers from 0-9
- Hexadecimal:
- Base 16.
- Has 16 values
- Represented with symbols 0-9 and letters A-F
Explain why a computer can only process binary data
- Computer consist of transistors/logic circuits
- ..that can only store process data in two states(on/off)
Note: similar question could be explain why data needs to be converted to binary
Uses of hexadecimals:
- Error codes. Eg#404
- HTML colour codes. Eg FFFFFF
- URL
- Memory Dump
- IP addresses
- Assembly language
- ASCII/Unicode
Why do Developers prefer to use Hexadecimals?
- Easier/quicker to understand/read/write
- Easier/quicker to debug
- Less likely to make a mistake
- Shorter representation//Takes up less screen space
Note: Think about the hexadecimal error code 404, the binary equivalent is: 010000000100. Which is easier to memorise?
Describe a similarity between Binary and Hexadecimal?
- They are both number systems
Describe a difference between Binary and Hexadecimal?
- Binary is base 2 whereas hexadecimal is base 16
- Binary only uses numbers whereas hexadecimal also uses letters//Binary only uses 0 and 1 whereas hexadecimal uses 0 to 9 and A to F
MAC Address
- made up of 48 bits
- shown as 6 groups of two hexadecimal digits
- First half represents Manufacturer
- Second half represents Serial number
- Uniquely identifies a device on the network
- eg. 11:11:11:11:11:11
- MEDIA ACCESS CONTROL (only use if not referred by the question!)
What is an overflow error?
- A computer has a predefined limit that it can represent (eg. 8bits)
- ..Overflow occurs when a value outside this limit should be returned
When does it overflow occur?
- Can occur when two binary numbers are added together
- …the result is cannot be represented in the current register.
- eg. 255+10 in binary cannot be represented in the current size of the register.
- Solution: use a 16 bit/2byte register
What is an overflow error?
- A computer has a predefined limit that it can represent (eg. 8bits)
- ..Overflow occurs when a value outside this limit should be returned
When does it overflow occur?
- Can occur when two binary numbers are added together
- …the result is cannot be represented in the current register.
- eg. 255+10 in binary cannot be represented in the current size of the register.
- Solution: use a 16 bit/2byte register
What Effect does a logical shift have on a binary number
Example1: 2 Left logical shifts on the binary number: 00010011
Result: 01001100
- The number has been multiplied by 2 to the power of 2
Example 2: 2 Left logical shifts on the binary number: 11010011
Result: 01001100
- Most significant bits are lost. The answer is incorrect
Note: before you answer these questions look at what is happening to your binary register. if a left most bit is lost use example 2 answer otherwise example 1.
Left shifts= multiplication by 2^number of shifts
Right shifts =Division by 2^number of shifts