1.4.1 Data Types Flashcards

(21 cards)

1
Q

How do number systems work?

A

They are referred to by their base; the number of symbols used to form combinations

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

Three examples of number systems?

A

Denary
Binary
Hexadecimal

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

What base is hexadecimal?

A

16
Using values 0-9, and then A-F

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

Pros and Cons of denary?

A

Easy to understand

Hard to use in electronics

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

Pros and cons of Hexadecimal?

A

It is easier to read and remember than binary

It is quicker to type than binary, hence less chance of typing errors.

Easy to transcribe to and from binary

Hard to use with Circuitry

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

Pros and cons of Binary?

A

Simple to use with circuitry

Difficult to read for humans

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

Uses of hexadecimal?

A

Used to represent colors (#RRGGBB)- each hex value represents the intensity of one of three color channels

Used to define MAC addresses

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

What is fixed point binary?

A

When binary numbers use a specifically placed binary point.

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

What’s sign and magnitude?

A

A binary value where the MSB acts as a sign bit:

1 = Negative, 0 = Positive

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

How to represent a number in two’s complement?

A

The MSB is negative, usually -128

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

How do you convert a positive number to a negative using two’s compliment?

A

Find binary value

Flip all bits

Add 1

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

What are binary floating point numbers?

A

The binary standard form that consists of the following:

A sign bit and mantissa, represented in 2’s compliment

An Exponent represented in 2’s compliment

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

How to normalize a floating point number?

A

Check the mantissa sign to see if positive or negative

Find the first bit which has a value opposite to the sign bit

Place binary point in front of this bit

Adjust the exponent, so the number maintains the same value.

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

How to convert a negative denary number to a Floating point number?

A

Calculate two’s compliment
Convert to fixed point
Normalize

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

How to add Floating point numbers?

A

Normalize both numbers, making sure both exponents are the same

Add the mantissa

Normalize the result

When subtracting: Convert the second number into a 2’s compliment negative value and do the same thing

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

How to make a logical shift right?

A

Shift every value rightward

Move LSB into carry bit

Pad with 0

17
Q

How to make an arithmetic shift right?

A

Pad front with MSB to preserve sign bit

Shift all other bits rightward

Shift LSB into carry bit

18
Q

How to make an arithmetic shift left?

A

Pad the end with a 0

Shift all other bits left

Shift MSB into carry bit (not preserved)

19
Q

How to multiply binary values?

A

Use arithmetic shifts and add them together

20
Q

How to make a circular shift left

A

Ending with the 2nd MSB and shift all left pad the end with MSB.

21
Q

How to make an circular shift right?

A

Moves the bits of a binary number to the right, with the rightmost bit wrapping around to the leftmost position