100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Overig

1.4 Data Types, Data Structures and Algorithms

Beoordeling
-
Verkocht
-
Pagina's
15
Geüpload op
11-09-2024
Geschreven in
2023/2024

This is the topic: 1.4 Data Types, Data Structures and Algorithms for the OCR A-Level Computer Science (H446) course. I got 4 A*s in my A-Levels (Computer Science, Physics, Maths, Further Maths) , so they are very detailed and cover all of the specification for this topic.

Meer zien Lees minder
Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Study Level
Publisher
Subject
Course

Documentinformatie

Geüpload op
11 september 2024
Aantal pagina's
15
Geschreven in
2023/2024
Type
Overig
Persoon
Onbekend

Onderwerpen

Voorbeeld van de inhoud

1.4 Data Types, Data Structures and Algorithms


1.4.1 Data Types

Primitive Data Types:

 Integer: Whole number (e.g. 2, 0, -5)
 Real: Any number with decimal places (e.g. 2.00, 5.83)
 Boolean: Restricted to True or False
 Character: A single symbol used by a computer
 String: A collection of characters (can be a single character)

Positive Binary Integers:

 Bit = A single binary digit. Eight bits are a byte. Four bits is a nibble.
 Least significant bit = Furthest to the right.
 Most significant bit = Furthest to the left.

A bit is 0 or 1. Having two states makes it simpler to build electronic devices. A binary number can
have a variety of different interpretations depending on what is being stored (e.g. numeric, text,
image, sound).

With positive integers, we can represent them in binary as usual.
(E.g.) 8 Bits:

128 64 32 16 8 4 2 1


Negative Binary Integers:

We can represent negative numbers in binary several ways:

 Sign and Magnitude
 Two’s Complement

Sign and Magnitude:

 Positive numbers start with a zero, negative
numbers start with a 1.
 Nothing else changes.
 The most significant bit has become a ‘sign bit’, so it doesn’t represent an actual value.
 Therefore, 8 bit numbers can only hold 7 bit values (but we now store -127 to 127).

Two’s Complement:

 Positive numbers start with a zero, negative numbers
start with a 1.
 The most significant bit is the negative of that value (e.g.
8 bits: -128).
 We can find the two’s complement of a number by calculating using the negative MSB or by
the simple method.
 Simple method:
o Write out positive version of number
o Invert all the bits (i.e. 1s become 0s and vice versa)
o Add one.


1

, Binary Addition and Subtraction:

Addition:

Because binary is base 2,
when we get 1 + 1, it
becomes 0 again and we
carry the 1.

Example: “95 + 222”
Here we have an overflow as we’re let with a 1 we need to carry.

We need an extra bit if there’s an overflow error.

Subtraction:

To subtract, we convert the number to subtract into two’s complement, then we add them.
Both numbers (to begin with) must be signed (i.e. 0 or 1 at start).

Hexadecimal:

 Hexadecimal is base 16. The characters 0-9 are
normal, and the characters A-F represent 10-15.
 Places start with 1 and go up in powers of 16.
 It’s useful to represent large binary numbers in a
smaller number of digits.
 They’re used to represent colours, MAC addresses, memory addresses, and more.

Hexadecimal to Binary:

 Convert the hexadecimal digits into their decimal numbers (e.g. 9 = 9, B = 11)
 Convert each of these into a binary nibble.
 Combine the nibbles to form a single binary number.

Hexadecimal to Denary:

 Convert the hexadecimal number into binary, then convert this into a denary number.
 Alternatively, use the place values of hexadecimal (1, 16, 256…).

Floating-Point Binary:

 To store fractional numbers in binary, we extend the number line from left to right. The
place values halve as we move from left to right (e.g. ½, ¼, 1/8) and we place a binary point
between the 1 and 1/2.
 The number line begins with a negative value (e.g. -16)

Fixed Point Binary: The position of the point is fixed on the number line and the range of numbers
we can store is limited, and some numbers can’t be stored accurately (e.g. 1/3).

 Positive: = 3.75


 Negative: = -6.5



2
€4,15
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
maddysunter1
5,0
(1)

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
maddysunter1
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
1 jaar
Aantal volgers
0
Documenten
16
Laatst verkocht
5 maanden geleden

5,0

1 beoordelingen

5
1
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen