OCR A Level CS 1.4.1 Data Types

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

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

26 Terms

1
New cards

What are the five primitive data types?

Integer, Real/Floating Point, Character, String, Boolean.

2
New cards

What is a character?

A single symbol used by a computer (e.g., A, 7, %).

3
New cards

How do computers store integers?

Using binary (base 2), where each bit represents a power of 2.

4
New cards

What is a byte?

8 bits.

5
New cards

What is a nibble?

4 bits (half a byte).

6
New cards

What are the two main methods to represent negative numbers in binary?

Sign magnitude and Two’s complement.

7
New cards

How does sign magnitude work?

The leftmost bit represents the sign (0 = positive, 1 = negative).

8
New cards

What is a problem with sign magnitude?

It has two representations for zero (00000000 and 10000000).

9
New cards

How does two’s complement work?

The most significant bit (MSB) represents a negative value.

10
New cards

How do you convert a number to two’s complement?

Flip all bits and add 1.

11
New cards

What are the four rules of binary addition?

  • 0 + 0 = 0

  • 0 + 1 = 1

  • 1 + 1 = 10 (carry 1)

  • 1 + 1 + 1 = 11 (carry 1)

12
New cards

How is binary subtraction done?

By using two’s complement and then adding.

13
New cards

What is hexadecimal (hex)?

A base 16 number system using 0-9 and A-F.

14
New cards

How do you convert binary to hex?

Group bits into 4-bit chunks and convert each group to hex.

15
New cards

Convert 10101110 to hex.

1010 1110 → AE.

16
New cards

What are the two parts of a floating-point number?

Mantissa and Exponent.

17
New cards

What is the purpose of normalisation?

To ensure maximum precision by adjusting the mantissa and exponent.

18
New cards

How do you normalise a floating-point number?

Adjust the number so it starts with 01 (positive) or 10 (negative).

19
New cards

What are the three types of bitwise operations?

Shifts, AND/OR/XOR, Masks.

20
New cards

What does a left shift do?

Multiplies a number by 2^n.

21
New cards

What does a right shift do?

Divides a number by 2^n

22
New cards

What is a mask?

A binary pattern used to extract or modify specific bits.

23
New cards

What are the two main character sets?

ASCII and Unicode.

24
New cards

How many bits does ASCII use?

7 bits, representing 128 characters.

25
New cards

Why was Unicode introduced?

To support multiple languages and more characters.

26
New cards

How many bits does Unicode use?

Variable length (16-bit, 32-bit, etc.).