2.3 Data Representation and Data Types (Binary, Hex, and Denary)

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

Bit

1 / 30

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

31 Terms

1

Bit

A bit is the smallest unit of data in computing. It is a binary digit that can hold either the value of 0 or 1.

New cards
2

Byte

A byte is a group of binary digits operated on as a unit. In most computer systems, a byte is made up of 8 bits.

New cards
3

Word

A word is the total number of bits that can be manipulated as a single unit by the CPU.

New cards
4

Boolean

A Boolean data type represents truth values and can only take on two possible values: true or false.
May be stored in a single Bit as 1 if true and 0 if false.

New cards
5

Character

A character data type is used to store a single character, such as a letter, digit, or symbol. Characters are often represented using character encoding standards like ASCII or Unicode.
ASCII Character: 1 byte (8 bits). ASCII characters range from 0 to 127.

New cards
6

String

A string is a sequence of characters used to represent text. Unlike single characters, strings can vary in length.
The storage requirement for a string depends on its length and the encoding used.
For example, a string of length nnn in ASCII would require nnn bytes.

New cards
7

Integer

An integer data type is used to store whole numbers (i.e., numbers without a fractional part). Integers can be signed (allowing negative values) or unsigned (positive values only).
The storage requirement is 8-bit (1 byte) Integer: Ranges from −128-128−128 to 127127127 (signed) or 000 to 255255255 (unsigned).

New cards
8

Real

A real (or floating-point) data type is used to represent numbers with fractional parts, allowing for the representation of decimal points.
The storage requirement is 32-bit(4 bytes)

New cards
9

Overflow error

An overflow error occurs when a binary value is too large to be stored in the bits available. (e.g., 128 for an 8-bit value)

New cards
10

Underflow error

An underflow error occurs when a number is too small to be stored in the bits available. e.g., 0.00005 for a 3-bit value

New cards
11

How to calculate absolute error

Absolute = original - new

New cards
12

How to calculate relative error

Relative = (absolute/original) * 100

New cards
13

Positive Whole Numbers (base 10) in Binary

The example in the picture represents 42 in 8-bit binary.

When representing a positive number in binary, it always starts from 0.

42 -> 00101010

This is wasteful, as zero can be represented twice

<p>The example in the picture represents 42 in 8-bit binary.</p><p>When representing a positive number in binary, it always starts from 0.</p><p>42 -&gt; 00101010</p><p></p><p><em>This is wasteful, as zero can be represented twice</em></p>
New cards
14

Negative Whole Numbers (base 10) in Binary

The example in the picture represents -42 in 8-bit binary.
When representing a negative number in binary, it always starts from 1.
-42 -> 11010110

<p>The example in the picture represents -42 in 8-bit binary.<br>When representing a negative number in binary, it always starts from 1.<br>-42 -&gt; 11010110</p>
New cards
15

2's Complement

Method for representing signed (positive, negative, and zero) integers.

-42 -> 11010110 (in two's complements)
-128+64+16+4+2 = -42

<p>Method for representing signed (positive, negative, and zero) integers.<br><br>-42 -&gt; 11010110 (in two's complements)<br>-128+64+16+4+2 = -42</p>
New cards
16

Arithmetic and Logical Left-shift of binary

Left-shift means you are multiplying the binary by 2

In Arithmetic left-shift, if the binary starts with 1 that is, it's minus, you will keep the minus when you left shift.
Example: -42 -> 11010110 will be become 10101100
-128+32+8+4 = -84

In Logical left-shift, if the binary starts with 1, it will become 0, that is, the binary will become positive.
Example: -42 -> 11010110 will become 01010100
64+16+4 = 84

New cards
17

Arithmetic and Logical Right-shift of binary

Right-shift means you are dividing the binary by 2

In Arithmetic right-shift, if the binary starts with 1 that is, it's minus, you will keep the minus when you left shift.
Example: -42 -> 1101011 will be become 11101011
-128+64+32+8+2+1 = -21

In Logical right-shift, if the binary starts with 1, it will become 0, that is, the binary will become positive.
Example: -42 -> 11010110 will become 00010101
16+4+1 = 21

New cards
18

Real Numbers

Numbers with decimal places like 2.5 or 3.141592654

New cards
19

Standard Form

Large numbers represented as Mantissa x 10^exponent
0.65625 X 2^6 represent 42

New cards
20

Exponent and Mantissa

Mantissa x 10^exponent
Mantissa must be between 0.5 and 1
0.5 <= Mantissa < 1

Exponent is part of a number indicating the power of the base

New cards
21

How to get exponent and mantissa

You will use a calculator to divide the number by 2 each time until you get an answer that's between 0.5 and 1. The answer is the mantissa. The number of 2 you use to get the answer is the exponent.

42 = 42 x 2^0 (no division)
42 = 21 x 2^2 (first division)
42 = 10.5 x 2^2 (second division)
42 = 5.25 x 2^3 (third division)
42 = 2.625 x 2^4 (fourth division)
42 = 1.3125 x 2^5 (fifth division)
42 = 0.65625 x 2^6 (sixth division)

New cards
22

16-bit Floating Point

16-bit floating point uses 8-bits for the Mantissa and 8-bits for the Exponent.
Both parts could use Sign & Magnitude or Two's Complement representation.

New cards
23

Representing Mantissa in binary

The image show how to represent a Mantissa of 0.65625

<p>The image show how to represent a Mantissa of 0.65625</p>
New cards
24

Representing Exponent in binary

The image show how to represent an exponent of 6

<p>The image show how to represent an exponent of 6</p>
New cards
25

16 bit floating point representation

knowt flashcard image
New cards
26

Real Number to fixed point binary

The image shows 25.57 in fixed point binary.

Convert the 25 to binary, then convert .75 using 1/2, 1/4 and so on.

<p>The image shows 25.57 in fixed point binary.<br><br>Convert the 25 to binary, then convert .75 using 1/2, 1/4 and so on.</p>
New cards
27

Difference between Floating Point and Fixed Point

Floating point
• It has set number of bits for mantissa and exponent
• trade-off between accuracy v range
• larger mantissa leads to greater accuracy
• larger exponent leading to greater range of numbers being represented
• It is not possible to represent zero.

Fixed point
• not flexible and has a set range and level of accuracy
• is less complex.

New cards
28

Hexadecimal (HEX)

Hexadecimal is base-16
There are 16 different characters available when using this system:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

A - 10
B -11
C - 12
D - 13
E - 14
F -15

New cards
29

Hex to denary (base 10)

AD9C
(10 x 4096) + (13 x 256) + (9 x 16) + (12 x 1)
40960 + 3328 + 144 + 12 = 44444

New cards
30

Base 10 to Hex

50672
50672/4096 = 12 - C
12 x 4096 = 49152
50672 - 49152 = 1520
1520/256 = 5 - 5
5 x 256 = 1280
1520 -1280 = 240
240/16 = 15 - F
15 x 16 = 240
240 - 240 = 0 - 0
50672 -> C5F0

New cards
31

Binary to Hex

10101101111011

Split into group of four

0010 1011 0111 1011

2B7B

When splitting up the Binary into group of 4, always start at the RIGHT

New cards

Explore top notes

note Note
studied byStudied by 51 people
... ago
5.0(1)
note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 14 people
... ago
5.0(1)
note Note
studied byStudied by 4 people
... ago
5.0(1)
note Note
studied byStudied by 59 people
... ago
5.0(3)
note Note
studied byStudied by 7 people
... ago
4.0(1)
note Note
studied byStudied by 123508 people
... ago
4.8(561)

Explore top flashcards

flashcards Flashcard (85)
studied byStudied by 4 people
... ago
5.0(2)
flashcards Flashcard (37)
studied byStudied by 17 people
... ago
5.0(1)
flashcards Flashcard (40)
studied byStudied by 11 people
... ago
5.0(1)
flashcards Flashcard (56)
studied byStudied by 548 people
... ago
4.8(5)
flashcards Flashcard (169)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (24)
studied byStudied by 4 people
... ago
5.0(2)
flashcards Flashcard (118)
studied byStudied by 52 people
... ago
5.0(1)
flashcards Flashcard (21)
studied byStudied by 2 people
... ago
5.0(1)
robot