100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

COMPACT SUMMARY FOR TOPIC 10: Data types

Rating
-
Sold
-
Pages
1
Uploaded on
15-08-2024
Written in
2022/2023

A-Level Computer Science Revision Guide: Data Types & Conversions Elevate your exam preparation with this detailed A-Level Computer Science revision guide on Data Types. This material provides in-depth explanations of primitive data types, conversions between binary, denary, and hexadecimal, and how numbers, characters, and floating-point numbers are stored and manipulated in memory. Ideal for students looking to solidify their understanding of how data is represented and processed in computing. Key Features: Primitive Data Types: Understand the basics of data storage. Binary, Denary, and Hex Conversions: Master essential number system conversions. Character Sets: Learn about ASCII, Extended ASCII, and Unicode. Floating Point Arithmetic: Grasp how real numbers are stored and normalised. Perfect for students aiming to excel in their exams!

Show more Read less
Institution
OCR








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 15, 2024
Number of pages
1
Written in
2022/2023
Type
Summary

Content preview

Computer science—A Level—Topic 10 Data Types
Primitive data types What is meant by the term ‘data type’?
The basic data types provided by a programming language as building blocks. A data type is like a class which different types of data fall into,
this is because different types of data can take up different
amounts of memory therefore to make sure a program is opti-
mised, we make sure we assign the correct data type to a certain
piece of data.
Conversions between Denary, Hex and Binary
•A Binary digit (Base 2) simply contains 0’s and 1’s suggesting there are
only 2 possible states.
•A Denary digit (Base 10) contains numbers 0-9.
Representing negative binary numbers •A Hex digit (Base 16) contains numbers 0-9 then the letters A-F.
•Sign & magnitude—a computing method of storing strings/binary
into negative values, it works by making the MSB into a sign bit <- Weight line
where 0 = positive and 1 = negative.

Denary → Binary
1.First draw the binary weight line.
2.Start from the MSB and place a ‘1’ under the first bit smaller than the
denary value and then take away the bit value from the denary value to
get new denary value.
•Twos complement—a computing method of storing floating
point real values (+ and -) where the MSB is the relative MSB but 3.Put ‘0’ under the bits that have higher values than the denary value.
negative. Denary → Hex
1.Convert the Denary into an 8-bit binary number.
2.Split the 8-bit binary number into 2 nibbles (4 bits).
3.Using a weighing line that goes up to 4 bits for each, convert each nibble
into hexadecimal values.
Binary → Denary
Positive → Negative using twos complement 1.Construct a weighing line.
1.First convert the positive denary value to binary. 2.Put the ‘0’s and ‘1’s into their corresponding positions and then add the
2.Starting from LSB, copy each digit until you reach the first ‘1’. values that the ‘1’s are underneath.
3.Beyond this point, swap all the 1’s and 0’s vice versa. How are numbers stored in memory?
In memory (RAM), capacitors either hold a charge(1) or don’t (0), it has two
Adding and subtracting binary numbers possible states which is how binary works, therefore data like numbers are
stored in binary values to represent the two states.
•In binary: 0+0 = 0 , 1+0 = 1, 1+1=1 (carry 1), 1+1+1=1 (carry 1). What examples are there where working with large binary numbers is a
problem, and what is the solution?
When storing many different colours of an image, as there is 16+ million
colours binary values would be immensely large however due to hexadeci-
mal being able to represent these in a more compact and human-friendly
way as we can represent an 8-bit binary in 2 bits.
Character sets
A character set is a defined list of characters recognised by the computer
hardware and software, with each character being represented by a single
number (in binary).
•Each character has its own unique binary codes.
An overflow error occurs when a value greater than 255 is cal- •They are agreed standards for referring to all the characters a computer
culated after binary addition using 8 bits. can use.
•To subtract binary numbers, convert the number we want to 1.ASCII ( American standard code information interchange ): ASCII codes
subtract into its twos complement form and follow the same bi- use 7-bits giving 32 control codes and 96 displayable characters.
nary addition rules. 2.Extended ASCII : Uses 8-bits which made it possible to store foreign char-
acters and a limited number of graphical symbols.
3.Unicode—uses 24-bits and the most widely used character set as its capa-
ble of storing all characters globally.
How does a computer store text in memory?
It stores all types of data in bina-
ry, the way the memory can
differentiate each binary code is
by using a character set which
are agreed standards for refer-
ring to all the characters a com-
puter can use for example 65
How does the ALU perform arithmetic? stored in binary would represent
Using the binary addition rules, it converts denary values into bi-
nary integers and adds them respectively, same with subtraction •Mantissa: the number itself.
except the number we subtract is in twos complement form.
•Exponent: position of binary
Floating point numbers point.
A data type used to store an approximation of a real number in a •Both are stored in twos com-
way that can support a trade-off between range and precision. plement form.
•Used to store float numbers in binary.
Normalisation is the process of
•A fixed-point binary has the binary point in a fixed position moving the binary point so that
therefore range of numbers we can store is limited. the first digit after the point is a
•A floating-point binary can move the weight line including either significant digit. This maximises
a higher range of numbers or higher accuracy. precision in a given number of
bits.
Converting floating point to denary •Normalised positives start
1.Exponent tells us how much to move the binary point in the mantissa by. with 0 1.
2.We discard the exponent now and apply the normal weight line where •Normalised negatives start
the binary point is between ‘1’ and ‘1/2’ keeping the bits in the position with 1 0.
relative to the binary point before applying the weight line.
£3.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
JackJordi05

Also available in package deal

Thumbnail
Package deal
-
14 2024
£ 47.86 More info

Get to know the seller

Seller avatar
JackJordi05 Cranfield University
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
14
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions