1 of 29

Topic 2 - Computer Architecture

IB Computer Science

2 of 29

Data Representation

3 of 29

Bits and Bytes

4 of 29

5 of 29

Binary

  • Language of the CPU and modern computing
  • 1, 0
  • Base 2

6 of 29

Binary→Denary

7 of 29

Examples

  • 11101001→
  • 10001101→

8 of 29

Examples

  • 11101001→233
  • 10001101→141

9 of 29

Denary→Binary

10 of 29

Examples

  • 168→
  • 83→

11 of 29

Examples

  • 168→10101000
  • 83→01010011

12 of 29

Hexadecimal

  • More efficiently represents large binary values
  • Colors
  • Memory addresses (esp. in assembly)
  • MAC Addresses
  • Base 16

13 of 29

Hexadecimal→Denary

14 of 29

Hexadecimal→Denary

15 of 29

Examples

  • 3B →
  • 18E →

16 of 29

Examples

  • 3B → 59
  • 18E → 398

17 of 29

Denary→Hexadecimal

18 of 29

Examples

  • 480 → 1E0
  • 232 → E8

19 of 29

Hexadecimal ↔ Binary

  • Each hexadecimal digit represents 4 binary bits
  • 111011 → 3B
  • 11010110 → D6
  • 92 → 10010010

20 of 29

How is text displayed?

  • Strings are made up of characters
  • Each character is represented by a certain number of bytes
  • Two formats: ASCII and Unicode

21 of 29

ASCII

  • Use 8 bits for each character
  • 7 bits used for each character, 1 bit is parity bit
  • 2^7 or 128 possible characters
  • Lower case, capitals, numbers, symbols, spaces, punctuation included

22 of 29

Unicode

  • Used to represent multiple languages
  • More bits, so more characters can be represented
  • UTF-8 → 8 bits

UTF-16 → 16 bits

UTF-32→32 bits

23 of 29

How are images displayed?

  • Each display (monitor, phone screen, etc.) is divided into pixels
  • pixel = “little square” in grid
  • pixel = smallest controllable element in display
  • Each pixel has a different color
  • Each pixel has one color at one moment
  • The color is combination of red, blue and green
  • Pixels together display image
  • 1024x764 screen resolution →1024 pixels high, 764 wide
  • 1080p, HD, 4K refers to number of pixels in screen

24 of 29

Pixels

  • Each color in each pixel represented by 6 digit hexadecimal value( Ex: 70EF5A)
  • First two values represent red, second two represent green and last two represent blue (Ex:70EF5A)
  • 16^2*16^2*16^2 = 256*256*256 possible color combinations

25 of 29

IB Questions

26 of 29

27 of 29

Answers

28 of 29

29 of 29