data representation Flashcards

1
Q

word size

A

number of bits a computer’s CPU can process at once
(amount register can hold + manipulate )

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

word

A

unit of data defining the number of bits that move around a computer from 1 component to another
made of bits

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

possible combinations

A

2^n
where n = no of bits

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

byte sizes

A

8 bits = 1 byte
1024 bytes - 2^10 bytes Kilobyte
1024 x 1024 bytes = 2^20 bytes Megabyte
Gigabyte
Terabyte
Petabyte
Exabyte

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

unsigned int

A

uses all of allocated bits to represent value

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

unsigned int

A

uses all of allocated bits to represent value

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

largest no. in an unsigned int

A

2^n - 1
one less than no. of combinations (since 0 is included as one of the values)

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

smallest no in an unsigned int

A

0

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

sign in binary

A

left most bit indicates the sign
0= positive 1 = negative

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

two’s complement

A

soln to adding neg binaries
- make no. binary (add leading 0s)
- reverse (swap 0s and 1s) and add sign
-add 1

check : if pos no + its 2s complement = 0. (ans is 8 bits)

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

from 2s complement to decimal

A
  • reverse 0s and 1s
  • add 1
    -convert to decimal equivalent
  • add - sign
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

largest no in signed int

A

2^(n-1) - 1
1 less bit because sign takes 1 bit

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

smallest signed number

A

-2^(n-1)

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

overflow

A

try to store a value in a data type that is outside the range data type
cause significant logical errors

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

normalised form

A

to understand real numbers
0.nnnn x 10^k (all digits moved to fraction part)
ensure no loss of accuracy- 0 can be excluded
nnnn - mantissa k- exponent
signed
lowest exponent: -2^(k-1), highest 2^(k-1) -1
mantissa limited to 9 digits - additional will be truncated/rounded - inaccurate
if too few digits for exponent- overflow

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