Data representation-numbers and coding Flashcards

1
Q

What is binary?

A

A number system which uses only two digits, 0 and 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a bit?

A

One binary digit

can be one or zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a byte?

A

A group of 8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a word?

A

A group of bytes

word size depends on the type of computer e.g. 8 byte machine has an 8 byte word size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a denary number system?

A

A number system which uses the digits 0..9

like our own number system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does a number base specify?

A

How much each digit is multiplied as you move from right to left

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What base does the binary system have?

What does this mean

A

base 2

-so place values are increasing powers of 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is another word for decimal?

A

denary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the largest binary number which can be stored in any n bits?

A

2^n-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the range of numbers which can be stored with 8 bits?

A

0..255

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How many values can be stored using 8 bits?

A

256

includes zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many values can be stored using n bits?

A

2^n

including zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is twos complement?

A

A system for representing negative binary numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In twos complement, how can you tell if the number represented is negative?

A

It will start with a one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you convert a negative decimal number to twos complement?

A
  • Make the decimal number positive
  • Convert this to binary
  • change all the ones to zeros and the zeros to ones
  • add one to the result
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you change the sign of a binary number?

A
  • start from the right
  • leave all digits up to and including the first one
  • change all other ones to zeros and zeros to ones
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the first method of converting a negative twos complement number to denary?

A
  • flip the bits
  • add one
  • convert the binary to denary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the second method of converting a negative twos complement number to denary?

A

Add all the place values with a one underneath them.

The leftmost place value will always have a negative value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the best method for binary subtraction?

A

Converting the number to be subtracted to negative twos complement and then adding the two

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How is -1 represented in twos complement?

A

With a one in all the place values

for any number of bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the most significant bit (MSB)?

A

The leftmost bit (bit with the largest value)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the least significant bit (LSB)?

A

The rightmost bit (bit with the smallest value)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is hexadecimal?

A

A number system which uses the digits 0..9 and letters A..F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is hexadecimal used for?

A

Making binary more convenient for humans to read

-a shorthand for binary number patterns

25
Q

What base does hexadecimal use?

A

base 16

26
Q

How do you convert hexadecimal to binary?

A

Each symbol of hexadecimal has a value of 4 bits of binary. convert each symbol and put these groups together in the same order as the hexadecimal to form a longer binary number

27
Q

What is 10 in binary and hexadecimal?

A

binary =1010

hexadecimal=A

28
Q

What is 15 in binary and hexadecimal?

A

binary=1111

hexadecimal=F

29
Q

How can real (non-integer) numbers be represented using binary?

A

With fixed point binary numbers

30
Q

How does a fixed point binary number work?

A

The halving of place values continues on after a set place for the (imaginary) decimal point
8 4 2 1 . 1/2 1/4 1/8 1/16 etc

31
Q

Is binary or decimal representation of fractions more precise?

A

decimal

32
Q

What does fixed point binary notation assume?

A

That the binary point is always in a set position as there is no third symbol which can be used to literally store it

33
Q

What are the most well known coding systems?

A

ASCII and unicode

34
Q

What is a coding system?

A

Used to store text in computer memory

Each character is represented using a different binary pattern

35
Q

How many different patterns (possiblities) are needed to represent all characters on a computer keyboard?

A

128

36
Q

How many bits are needed to represent every symbol on a computer keyboard?

A

seven bits

37
Q

How many bits are needed to represent 128 values?

A

seven

38
Q

How is a character represented in ASCII?

A

A 7 bit binary integer

with an 8th parity bit

39
Q

What is unicode?

A

A coding system which uses 16 bits to represent characters

allowing for more symbols than ASCII

40
Q

What is a parity bit?

A

One bit added on to the end of a bit pattern to check for errors

41
Q

How does even parity work?

A

The parity bit in the pattern is set to either a one or a zero to make the total number of 1s is an even number
If an odd number of 1s is receiver then there was an error in transmission

42
Q

How does odd parity work?

A

The parity bit in the pattern is set to either a one or a zero to make the total number of 1s an odd number
If an even number of 1s is receiver then there was an error in transmission

43
Q

Why is data not always correct even if the parity bit looks correct?

A

If an even number of errors occurs then the parity bits system will not detect any errors

44
Q

What is the majority vote method?

A

Sending the same data three times and using the pattern which appears the most times

45
Q

What is a disadvantage of the majority vote system?

A

It is very expensive as three times as much data has to be transmitted

46
Q

What is hamming code?

A

A system which can self correct single errors using multiple parity bits in a bit pattern

47
Q

How does Hamming code work?

A

All bit positions that are powers of 2 are used as parity bits, all other positions are used for encoding data to be sent
Each parity bit checks, from itself onwards, alternate bit sets the size of its position value
ie 2=check 2, skip 2, check 2 etc

48
Q

Why is Hamming code often still used today?

A

It has a good balance between error correction and detection

49
Q

How is an error located using Hamming code?

A

The position value of the error is the sum of the parity bits with wrong sections
(if the error is on a parity bit this is its value+0, so just the parity bit)

50
Q

How many errors can hamming code detect/correct?

A

It can detect two bits and correct one bit

51
Q

What happens when there is more than one error in hamming code?

A

The position values will add up to more than the range of the code

52
Q

What is gray code?

A

Binary code where two consecutive values are only one bit different from each other
(even when the maximum value resets to zero)

53
Q

What is the full name of gray code?

A

Binary reflected gray code

BRGC

54
Q

Why is gray code used?

A

In slow systems as the state changes a different number could be picked up before all of the bits have been changed
This cannot happen with gray code so data is more reliable

55
Q

What can gray code be used for?

A

Angular movement systems where angular positions have to be known

56
Q

How is a gray code counters output different from a pure binary counters output?

A

It toggles only one output bit at a time whereas a pure binary counter could toggle more

57
Q

What is the advantage of gray code counters over equivalent standard binary counters?

A

They consume half of the electrical power

58
Q

How many numbers can be represented by 4 bit gray code?

A

15

59
Q

List the numbers which can be represented with 4 bit gray code

A
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1010
1011
1001
1000