1.4.1 Data Types

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Integers

Whole numbers. Includes zero and negative numbers

2
New cards

Real numbers

Positive or negative numbers which can, but don’t necessarily, have a fractional part

3
New cards

Character

A single symbol used by a computer

4
New cards

String

A collection of characters

5
New cards

Boolean

True or False

6
New cards

Binary addition

  • 0 + 0 = 0

  • 0 + 1 = 1

  • 1 + 1 = 10

  • 1 + 1 + 1 = 11

7
New cards

Sign magnitude binary numbers

The most basic way to represent negative numbers in binary. A leading 1 is added for a negative number, and a leading 0 is added for a positive number

8
New cards

Two’s complement

Much simpler way of representing negative binary numbers. Works by making the most significant bit negative. Converting to a two’s complement negative number is as simple as flipping all the bits in the positive version and adding 1

9
New cards

Subtracting in binary

The same as adding a negative number. Both numbers are converted to two’s complement and then added together. A positive number will begin with a 0 and a negative will begin with a 1

10
New cards

Floating point in binary

A decimal point is added after the rightmost bit of representing 1, and the bits continuing right after half in size each time. E.g. 4 2 1 . 0.5 0.25 0.125

11
New cards

Normalisation

The number is split into two parts: mantissa and exponent. In the case of 6.67×10, the mantissa is 6.67 and the exponent is -11. To normalise, the binary number is adjusted so that it start with 01 for a positive and 10 for a negative. The exponent is added after based on how many shifts in which the direction the number has been adjusted

12
New cards

Addition of normalised numbers

Modify the numbers so that the exponents are the same by manipulating the mantissa. The two mantissas can then be added as normal, making sure the final result is in a properly normalised form

13
New cards

Subtraction of normalised numbers

Works exactly the same as addition except the mantissas are converted to two’s complement

14
New cards

Logical shifts

Involves moving all bits in a binary number a specified number of places to the left or right, adding in additional 0s to the empty spots

15
New cards

Arithmetic shift

The same process as a logical shift, except instead of always filing with 0s, the most significant bit in the direction of shift is copied to fill the gaps

16
New cards

Masks

Can be applied to binary numbers by combining them with a logic gate

17
New cards

Character sets

A published collection of codes and corresponding characters which can be used by computers for representing text

18
New cards

ASCII

The leading character set before Unicode. Uses 7 bits to represent 128 different characters. American Standard Code for Information Interchange. Soon came into trouble when computers needed to represent other languages with different characters

19
New cards

Unicode

Solves the problem of ASCII’s limited character set. Uses a varying number of bits allowing for over 1 million different characters