Computer Science · Theme A: Concepts of computer science
A1.2 — Data representation and computer logic
Computer Science · SL / HL · syllabus-mapped notes
CS_A1.2.1
Representing data: binary and hex
Binary and hexadecimal integers, and converting between them and decimal.
Full note — freeYou must be able to describe how integers are represented in binary and hexadecimal , and convert between these and decimal. Binary : base 2, using only the digits 0 and 1. Each position is a power of 2 (1, 2, 4, 8, 16, ...). Hexadecimal : base 16, using digits 0 to 9 then A to F (A=10, B=11, C=12, D=13, E=14, F=15). Each position is a power of 16. Decimal : the everyday base 10 system, digits 0 to 9. Binary to decimal Add the place values wherever there is a 1. e.g. 1011 = 8 + 0 + 2 + 1 = 11. Decimal to binary Repeatedly divide by 2 and read the remainders bottom-to-top (or subtract the largest powers of 2). e.g. 13 = 8 + 4 + 1 = 1101. Hexadecimal to decimal Multiply each digit by its power of 16 and add. e.g. 2F = (2 × 16) + 15 = 47. Decimal to hexadecimal Repeatedly divide by 16 and read the remainders (10 to 15 become A to F) bottom-to-top. e.g. 47 = (2 × 16) remainder 15 → 2F. Binary to hexadecimal (and back) Group the bits into nibbles of 4 (from the right); each nibble is one hex digit. To go back, expand each hex digit to 4 bits. e.g. 1011 1111 = B F = BF; and 3A = 0011 1010.
CS_A1.2.2
Storing data in binary
How integers, text, images, audio and video are all encoded as bits.
You must be able to explain how binary is used to store data. At the lowest level a computer can only store two states (0 and 1), so every kind of data must be encoded as a pattern of bits (grouped into 8-bit bytes ). …
CS_A1.2.3
Purpose and use of logic gates
The seven Boolean operators and the gates that implement them.
You must be able to describe the purpose and use of logic gates : physical circuits that take one or more binary inputs and produce a single binary output according to a Boolean operator . They are the building blocks from which all digital computing …
CS_A1.2.4
Constructing and analysing truth tables
Truth tables, Boolean expressions, Karnaugh maps and simplification.
You must be able to construct and analyse truth tables : a table listing every possible combination of inputs and the resulting output. With n inputs there are 2ⁿ rows. Predicting circuit output: work through each gate for every input row to fill the final …
CS_A1.2.5
Constructing logic diagrams
Wiring standard gate symbols into circuits and simplifying them.
You must be able to construct logic diagrams : drawings that show how logic gates are connected and interact in a circuit, with inputs flowing left to right through the gates to produce outputs. Use the standard gate symbols for AND, OR, NOT, NAND, NOR, …
