Back to marketplace

1.4 Data types, data structures and algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What are the different types of data? (5)

Back (Answer)

-integer -boolean -real/floating point -character -string

#2
Front (Question)

What is an integer data type?

Back (Answer)

whole numbers (includes 0 and -ve numbers)

#3
Front (Question)

What is a boolean data type?

Back (Answer)

values which are restricted to true and false

#4
Front (Question)

What is a real/floating point data type?

Back (Answer)

+ and -ve numbers which can also be fractional/decimal numbers

#5
Front (Question)

What is a character data type?

Back (Answer)

a single symbol used by the computer -include the letters A to Z, the numbers 0 to 9 and hundreds of symbols like % and £

#6
Front (Question)

What is a string data type?

Back (Answer)

a collection of characters

#7
Front (Question)

How are integers stored on computers? How does this work?

Back (Answer)

-stored using binary -computers count in base 2 -0 is just to show an ‘empty space’ whereas the 1 shows the number which the integer will consist of [0= false, 1=true] 128 64 32 16 8 4 2 1 -the row above shows the place value of each digit of the number (remember computers count in base 2 e.g. 2^2, 2^3) -if the binary code beneath consists of 1 then the integer will be made up of the place value above the 1 e.g. 128 64 32 16 8 4 2 1 0 1 0 0 1 1 0 1 64+ 8 +4 +1 = 77

#8
Front (Question)

Explain how we can convert the binary code into denary

Back (Answer)

128 64 32 16 8 4 2 1 0 1 0 0 1 1 0 1 -the row below is the binary code which can be converted into an integer by adding the numbers which have a value of 1 -in this case we add 64, 8, 4 and 1 as they have a place holder value of 1 which gives a number of 77

#9
Front (Question)

Explain how we can convert denary into binary code

Back (Answer)

-first step: find the largest power of two which is smaller than the number you’re converting, then write up the place values in power of 2 up to this power e.g. , if we were converting the decimal 47 into binary, we would write out place values up to 32 32 16 8 4 2 1 -then, place a 1 or a 0 in each position so that the total adds up to 47 starting with the most significant bit (32) -if we write a 1, then we subtract the place value from our value and use the result for the next stage e.g. 47-32= 15 -as 16 is larger than 15 a 0 will be used as an empty space/false number so we move on to the next numbers and continue the steps until we reach the final bit and the number is complete 32 16 8 4 2 1 1 0 1 1 1 1

#10
Front (Question)

What are the four rules when adding binary code?

Back (Answer)

• when adding 0 + 0 it always gives a 0 • when adding a 0 + 1 it always gives a 1 • when adding 1 + 1 you carry the one to the next addition and instead place a zero • when adding a 1 +1 + 1 you carry the one to the next addition and instead place a 1

#11
Front (Question)

How do we add binary code together?

Back (Answer)

-line up digits -start from right hand side (least significant bit) -add values from each column whilst following the rules -if the value has an overflow error (having an extra digit at the end), write out the code with the extra digit noting the error -convert value into denary to check if calculation is correct

#12
Front (Question)

What are the two methods which can represent negative numbers in binary?

Back (Answer)

-sign and magnitude -two’s complement

#13
Front (Question)

Explain how sign and magnitude works

Back (Answer)

-equivalent of adding a + or - sign in front of a number -binary can only use 0s and 1s, so instead we represent the signs using 0 as positive and 1 as negative. e.g. [010101101] = 173 [110101101] = -173

#14
Front (Question)

How can we convert from sign and magnitude into denary and vice versa?

Back (Answer)

-same as converting normally from binary to denary and vice versa -only difference is adding the sign at the end of the largest significant bit for binary and adding a +/- to a denary number

#15
Front (Question)

Explain how two’s complement works

Back (Answer)

-works by making the most significant bit negative e.g., the most significant bit, usually 128, represents -128 -add place values as normal e.g., -128 64 32 16 8 4 2 1 1 1 1 1 1 0 0 1 so: -128 + 64 + 32 +16 + 8 +1= -7

#16
Front (Question)

How can we add binary numbers using two’s complement?

Back (Answer)

-flip the first number (all 0s turn to 1 and vice versa) -add as a normal binary

#17
Front (Question)

What is hexadecimal?

Back (Answer)

makes use of the characters A-F to represent numbers 10-15

#18
Front (Question)

Show the conversions between denary and hexadecimal

Back (Answer)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <—-DENARY 0 1 2 3 4 5 6 7 8 9 A B C D E F <—-HEXADECIMAL

#19
Front (Question)

How do we convert hexadecimal into binary and vice versa?

Back (Answer)

B2 -split into two characters –> B 2 -convert both into denary –> 11 2 -convert denary into binary -combine both binary sections into one -for vice versa, split the binary into sections of 4 bits and do the opposite

#20
Front (Question)

How do we convert hexadecimal into denary and vice versa?

Back (Answer)

-first convert hexadecimal into binary -convert binary into denary -do opposite for vice versa

#21
Front (Question)

How can floating point numbers be shown in binary?

Back (Answer)

-can be split into two parts: mantissa and exponent e.g., 6.63 x 10^-11 mantissa is 6.63 and exponent is -11 -the last bit next to the most significant bit shows the sign (remember 0 is positive and 1 is negative sign)

#22
Front (Question)

How does the mantissa and exponent work in binary?

Back (Answer)

-the mantissa is always taken to have the binary point (same as a decimal point) [as the mantissa is considered a binary point the binary number e.g. 1100100111 becomes 1.100100111] -the exponent is used to show the shift of how many places the decimal point moves and in which direction -mantissa comes first then the exponent (which will also have the smaller bytes) e.g. 6.63 x 10^-11 mantissa is 6.63 and the exponent is -11 so the decimal point will be shifted 11 times from the decimal point to give us 0.0000000000663

#23
Front (Question)

How do we convert the a floating point number into denary?

Back (Answer)

-convert exponent into denary using the normal method -as the mantissa is considered a binary point the binary number e.g. 1100100111 becomes 1.100100111 -move the binary point the required number of places that the exponent gives (e.g. moving the binary point 5 places to the right of the mantissa) -this mantissa can then be converted to the denary version [REMEMBER for the place values in decimal, the computer counts in base 2s so it goes on as 2^-1, 2^-2 etc) [REMEMBER WITH TWO’S COMPLEMENT IF THE INIRIAL BIT IS A NEGATIVE THE MOST SIGNIFICANT PLACE VALUE IS A NEGATIVE] e.g. 32 16 8 4 2 1 . 0.5 0.25 0.125 0.0625 1 1 0 0 1 0 . 0 1 1 1 32 + 16 + 2 + 0.25 + 0.125 + 0.0625 = 50.4375

#24
Front (Question)

Give the decimal place values for binary. Explain how we get these numbers

Back (Answer)

0.5 0.25 0.125 0.0625 [REMEMBER for the place values in decimal, the computer counts in base 2s so it goes on as 2^-1, 2^-2 etc)