data types Flashcards

1
Q

character set

A

the mapping of a collection of characters to specific bit sequences or codes

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

all data types are held in the computer as…

A

binary

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

character

A

a letter, number or special character typically represented in ASCII

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

max and min values represented by n bits in binary

A

min =0
max = 2^n -1
(so total characters represented 2^n)

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

why is hex used rather than binary

A

less likely to make mistakes
easier to remember
simpler

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

define bit

A

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

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

increasing order of numbers 2^10, 2^20….2^80

A

kibi (Ki), mebi (Mi), gibi (Gi), Tebi (Ti), Pebi (Pi), Exbi (Ei), Zebi (Zi), Yobi (Yi)

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

increasing order of numbers 10^3, 10^6…10^24

A

Kilo (K), Mega (M), Giga (G), Tera (T), Peta (P), Exa (E), Zetta (Z), Yotta (Y)

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

ASCII- american standard code for information interchange

A

historically the standard code for representing letters on keyboard. first 32 = non printing. 7 bits = 128 characters. developed to 8 bits (compatible by just adding a 0) so 128 more characters for symbols

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

UNICODE

A

1980s, several incompatible coding systems for different languages, difficulty because multilingual data increasingly used, so UTF-16, 65536 characters for different languages e.g. Latin, Greek, Arabic. First 128 same as ASCII so compatible. then UTF-32 inc chinese and japanese.
But now each character- 4 bytes rather than 2 so inc file sizes and transmission times.

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

overflow

A

when most significant bit has a carry, requiring an extra bit. when when the largest number a register can hold has exceeded its max word size

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

why is sign and magnitude bad for arithmetic

A

can’t just add binary digits, difficult for representing in hardware

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

range using two’s complement

A

-2^(n-1) ….. 2^(n-1) -1

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

fixed point accuracy

A

less accurate, some fractions can’t be represented at all and truncating to fractional places means less accurate and rounding errors.
range is limited by fractional part: can have larger, less acc numbers or smaller more acc numbers

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

floating point acc

A

much larger numbers and more accurate.

mantissa determines precision and exponent determines range.

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

normalisation

A

process of moving the binary point to provide max level of precision for a given number of bits

17
Q

normalised binary mantissa

A

lies between half and one or minus half and minus one for negative

18
Q

logical shift instructions

A

all the bits move left or right

19
Q

why is logical shift useful

A

for examining LSB/MSB: carry bit can then be tested and a conditional branch executed

20
Q

logical shift right explain..

A

LSB shifted to carry bit and zero moves into MSB to occupy vacated space

21
Q

arithmetic shift instructions

A

all bits move left or right except sign bit, which is taken into account and remains the same

22
Q

arithmetic shift left explain..

A

shift bypasses the sign bit so the MSB remains the same but all other bits shift left and second bit from left is now in carry bit

23
Q

effect of arithmetic shift left

A

multiplying by 2

24
Q

effect of arithmetic shift right

A

dividing by 2

25
Q

how can you multiply two binary numbers

A

arithmetic shifts and addition

26
Q

multiply 9 x 5 using arithmetic shifts?

A

9x1 ADD 9x4 via 2 left shifts

27
Q

circular shifts/rotate shifts are useful for

A

shifts in multiple bytes

28
Q

circular shift right explain…

A

LSB value moved to carry bit

29
Q

define bitwise operations

A

similar to boolean logic operations but they work on individual bits in a byte rather than whole codes or characters

30
Q

define masks

A

bit patterns that have been defined by a programmer, allowing specific bits in a piece of data to be altered or tested

31
Q

masks: how to reset/turn off a bit to 0

A

can’t use OR, use AND instead

32
Q

masks: how to turn on a specific bit

A

can use OR

33
Q

masks: how to check a specific bit

A

set all other bits to 0 using ‘AND 0’ as operation and mask except for the specific bit: 1

34
Q

masks: how to toggle bits- turn bits on and off at the same time

A

use ‘XOR’ operation and 0 for the ones to remain the same and 1 for the ones to toggle