DATA TYPES Flashcards

(15 cards)

1
Q

Increasing the number of bits used for the mantissa increases the __________ of the number that can be stored

Increasing the number of bits used for the exponent increases the __________ of the number that can be stored

A
  • Precision
  • Range / size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Describe the advantages of storing values using two’s complement instead of sign and magnitude

A
  • Calculations are more easily performed on two’s complement
  • Two’s complement allows for a (negligible) larger range of numbers to be stored
  • Two’s complement only has one representation for 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe what is meant by the term ‘character set’

A
  • List/mapping of characters that can be understood by the computer
  • Each character is given a unique binary code that is stored instead of the character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State why a programmer would prefer to use hexadecimal numbers rather than binary numbers

A
  • Hexadecimal values are shorter than binary as 4 bits/nibble can be represented by one hex character
  • Hexadecimal values are faster /more reliable to communicate/enter/write down/read
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the similarities between ASCII and Unicode

A
  • Both use binary to represent characters (are character sets)
  • The first 7 bits of Unicode is the same as ASCII
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the differences between ASCII and Unicode

A
  • ASCII has fewer characters (128)
  • Unicode has more characters
  • ASCII is 7 bits whereas Unicode can be larger (16/32) / can have variable sized characters
  • ASCII limited to English characters whereas Unicode can represent other symbols (e.g. Chinese, Emojis)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State why computers store data in binary

A
  • Computers use binary logic for on/off (1/0)
  • Computer systems are based on switches/transistors
  • Having additional states would make the components more difficult to build and more prone to error
  • Binary is high tolerance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Given that computers store everything in binary, explain how they are able to represent text

A
  • Computers use a character set
  • To map binary values to characters
  • Each character is represented by a unique value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you convert positive numbers into negative numbers using two’s complement

A
  • Write out the positive version of the number
  • Starting from the least significant bit, copy each of the digits exactly as they appear, up to and including the first 1
  • From this point on, swap every 1 for a 0 and every 0 for a 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is hexadecimal used to represent

A
  • Colours
  • Memory addresses
  • MAC addresses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the different ways bit patterns can be represented and why can we never assume what they represent

A
  • Numeric
  • Text
  • Image
  • Sound
  • There is no way of knowing what a particular pattern of bits represents until you know how to interpret that data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does masking allow us to do to bit patterns

A
  • Isolate and extract bit values in a sequence of bits
  • Toggle and set bit values in a sequence of bits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does an AND mask work

A
  • In all instances where the mask is set to 0, the original binary sequence is blanked out
  • In all instances where the mask is set to 1, the original binary sequence is copied
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does an OR maks work

A
  • In all instances where the mask has been set to 1, the values are set
  • In all instances where the mask has been set to 0, the values are kept the same
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does an XOR mask work

A
  • In all instances where the mask has been set to 1, the bit shave been toggled
  • In all instances where the mask has been set to 0, the bits have remained the same
How well did you know this?
1
Not at all
2
3
4
5
Perfectly