131 Week 2 - Information Coding Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Why do we need information coding

A

To allow for more complex data and data types to exist but still be coded into (or represented as) something that is cheap and easy to store and process.
Computer hardware handles data types and data as small positive whole numbers.

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

ASCII

A

American Standard Code for Information Interchange
Defines 128 (2^7) symbols - 7 bit binary.

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

How can negative numbers be represented?

A

Sign and magnitude, excess n

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

Sign and magnitude

A

A character is used to represent if a number is negative or positive. It is then followed by the magnitude of the number.
It works however a column is sacrificed and 0 can be represented twice as it can be positive or negative.

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

Excess n

A

Uses n as a new value for 0. Any positive number is added to the n and any negative number is subtracted from the n.
e.g., 150 in excess 5000 is 5150. -25 in excess 5000 is 4975.
It doesn’t use an extra column and has a single value for 0.

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

How can decimal numbers be represented?

A

Fixed point, floating point

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

Fixed point decimals

A

Some columns are reserved for the fractional part of a number.
However this is not a very efficient use of columns.

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

Floating point decimals

A

Trades precision for range by using a mantissa and exponent to represent numbers. Mantissa and exponent are represented with sign and magnitude.
Mantissa * Radix^exponent

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

Radix

A

The amount of characters a number system uses to represent numbers.
Also called the base

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

Denary (decimal)

A

A way of representing numbers using 0-9
Radix (base) 10

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

Binary

A

A way of representing numbers using 0,1
Radix (base) 2

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

Octal

A

A way of representing numbers using 0-7
Radix (base) 8

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

Hexadecimal

A

A way of representing numbers using 0-9, A-F
Radix (base) 16

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

Addition rules for adding binary numbers

A

0+0=0
1+0=1
0+1=1
1+1=0 carry 1
1+1+1=1 carry 1

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

Problems with sign and magnitude and excess n arithmetic

A

Sign and magnitude: doesn’t deal with overflow
Excess n: x – y ≠ x + (-y)
Would need extra hardware to be able do subtraction as well as addition for excess n. This would be less space and cost effective.

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

2’s Complement

A

A way of representing negative numbers where they can be added and subtracted from each other.

17
Q

Converting +ve to -ve in 2’s complement

A

Start with the equivalent positive number
Flip all bits (0 to 1, 1 to 0)
Add 1 to the number, ignoring overflow.

18
Q

IEEE 754 Standard floating point

A

Mantissa is coded in sign and magnitude
Exponent is coded in excess n
Has multiple precisions: half, single, double, quadruple.

19
Q

Single precision IEEE 754

A

Uses 32 bits overall
First bit is used for mantissa sign bit
Next 8 bits used for exponent in excess 127
Remaining 23 bits used for mantissa magnitude.

20
Q

How is the mantissa normalised for IEEE 754

A

Mantissa is always normalised to start as 1.xxxxx
The first bit then does not has to be stored as it will always be 1. and can just be assumed to be so.