1.4.1 - data types Flashcards

6

1
Q

primitive data type

A

One which is provided by a programming language.
e.g., integer, real, string

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

overflow error

A

occurs where a carry from the most significant bit requires a
ninth bit

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

2 methods to represent negative numbers in binary

A
  • sign and magnitude
  • two’s complement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

bit

A

The fundamental unit of information in the form of either a single 1 or 0.

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

kibibyte (KiB)

A

1024 bytes

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

full form of ASCII

A

American standard code for information interchange

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

ASCII

A
  • originally 7 bits
  • now 8 bits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What do the first 32 codes of ASCII represent?

A

non-printing characters used for control such as backspace

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

unicode

A
  • originally (UTF-16)
  • now, (UTF-32)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How was compatibility retained between Unicode and ASCII?

A

The first 128 codes in Unicode were the same as ASCII.

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

0+0

A

0

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

0+1

A

1

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

1+1

A

0 carry 1

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

1+1+1

A

1 carry 1

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

overflow errors

A

Where a carry from the most significant bit requires a
ninth bit.

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

sign and magnitude

A
  • change the MSB to 0 if positive
  • change the MSB TO 1 if negative
17
Q

MSB

A

most significant bit

18
Q

two’s complement

A
  • copy out positive binary upto and including the first 1
  • flip the rest
19
Q

normalisation

A

The process of moving the binary point of a floating point number to provide the
maximum level of precision for a given number of bits.

20
Q

How can we identify a normalised number?

A
  • positive number start with 01
  • negative numbers start with 10
21
Q

arithmetic shift

A

It takes into account the sign bit, which always remains the same.

22
Q

NOT

A

flip all the bits

23
Q

AND

A

both have to be 1

24
Q

OR

A

atleast one has to be 1

25
Q

XOR

A

only one has to be 1

26
Q

character set

A

List of characters that can be understood by the computer. Each character has a unique binary code that is stored instead of the character.

27
Q

2 reasons why a programmer would use hexadecimal over binary

A
  • hex is shorter than binary as a nibble can be represented by 1 hex character
  • hex values are more reliable to enter
28
Q

2 benefits of normalised form with floating point

A
  • Allows for more accuracy/precision from the given number of bits.
  • The representation of each binary value is unique.