Topic 2 - Data Flashcards
What is binary used for?
To represent data and program instructions.
How is data represented in a computer system?
As patterns of bits.
What is a nibble?
A group of four bits.
What is a byte?
A group of eight bits.
The formula for calculating how many unique binary patterns can be generated by n bits is 2^n, where n is the number of bits.
…
What is a denary number?
A decimal number.
What are the place values in a binary system?
128 64 32 16 8 4 2 1
What method is used to represent a signed number?
Two’s compliment.
In two’s compliment what makes a number negative?
If the most significant bit (MSB; the leftmost bit) is 1.
In two’s compliment what makes a number positive?
If the most significant bit (MSB; the leftmost bit) is 0.
Describe how two’s compliment works when converting a negative binary number to its positive binary equivalent.
1) Write it out
2) Flip all the bits
3) Add 1
Describe how to find a negative number using two’s compliment notation.
1) Write it out in binary
2) Flip all the bits
3) Add 1
How would you calculate a subtraction of denary numbers in binary?
1) Convert the first number to binary
2) Convert the negative number to binary using two’s compliment
2) Carry out the rules of addition
How does logical shift left work?
- Move each binary digit n positions left.
- Discard the leftmost n bits.
- Fill up the empty spaces on the right with 0’s.
How does a logic shift right work?
- Shift each binary digit n positions right.
- Discard the rightmost n bits.
- Fill up the empty spaces on the left with 0’s.
How is an arithmetic shift right different to a logic shift right?
The vacant spaces on the left are filled with the value of the original most significant bit.
What is an overflow?
When an operation produces a result that requires more bits to store it than are available in the computer.
How do you respond to an overflow?
A 9th bit is required. The programmer must make allowances for this to prevent serious errors or disasters.
What are the consequences of an overflow error?
- the program may crash
- the program may produce unreliable or incorrect results
What is hexadecimal?
Hexadecimal numbers represent long binary numbers using fewer digits. Every eight digits of a binary number can be represented by two hexadecimal digits.
How do you convert binary to hexadecimal?
- Split the 8-bit byte into two 4-bit nibbles
- Convert the bits in each nibble into denary numbers using the place values
- Add these together to give the hexadecimal
How do you convert the hexadecimal to binary?
- Each hexadecimal digit is converted to denary
- Each denary number is converted into a nibble
- The nibbles are combined to give the binary number
What are the three uses of hexadecimal?
- To help humans cope with long strings of binary digits - they’re much shorter in hex.
- When a computer malfunctions, error code numbers are usually given in hexadecimal.
- Hexadecimal is also used to represent numerical values in assembly language.
What are the three uses of hexadecimal?
- To help humans cope with long strings of binary digits - they’re much shorter in hex.
- When a computer malfunctions, error code numbers are usually given in hexadecimal.
- Hexadecimal is also used to represent numerical values in assembly language.