1.4.1 Data Types Flashcards

1
Q

What is a logical shift?

A
  • a shift performed on a binary numbers
  • logical shift left : multiplication
  • logical shift right : division
  • n= number of places shifted, has the effect of multiplying or dividing by 2^n
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Masks

A

Can be applied to binary numbers by combining them with logic gates

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

Bits and bytes

A
  • a bit is a binary digit (can be 1 or 0)
    -which is the fundamental unit of information
  • 1 and 0 are used to represent 2 electrical states on and off
  • 8 bits = 1 byte
  • 4 bits = 1 nibble
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Character set

A
  • A published collection of codes paired with corresponding characters.
  • Enables computers to represent text using binary code.
  • Two main character sets are Unicode and ASCII.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ASCII (American Standard Code for information interchange)

A
  • a character set used to map binary values to characters [1]
  • uses 7 bits to encode each character [1]
  • can represent 128 distinct characters
  • is used to represent characters in the English language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ASCII benefits

A

Uses a lot less storage space than Unicode

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

ASCII drawbacks

A
  • it has a limited number of characters/ is limited to 128 characters
  • it can’t represent multilingual characters/text
  • it does not include special characters like emojis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Unicode

A
  • a character set which is used to map binary values to characters [1]
  • uses up to 32 bits to encode each character [1]
  • it supports a very large number of characters [1]
  • used to represent characters across the world
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Unicode benefits

A
  • it can represent more characters than ascii
  • it can represent special character such as emojis
  • it can represent multilingual text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Unicode drawbacks

A

It uses a lot more storage space than ASCII

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

Trade off between accuracy and range

A
  • larger mantissa increases accuracy [1]
  • smaller exponent decreases range [1]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain how codes are used to represent a Character set

A
  • each symbol has a unique binary code [1]
  • e.g ascii uses 7 bits per character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly