Biteresources.com



Lesson Objectives:

To be able to:

- Define the terms bit, nibble, byte, kilobyte etc …

- Understand that data needs to be converted into a binary format to be processed by a computer

- To be able to convert positive binary to decimal and vice versa

Starter

Q1) What is binary?

Q2) Why do computers use binary?

The table below shows measurements for data or you can think of it as capacity. Use Google to help you fill the table below:

|Bit |A bit is equal to a 1 or 0 |

|Nibble |4 bits |

|8 bits | |

|1024 bytes |1 kilobyte |

|1024 kilobytes | |

|1024 megabyte | |

|1024 gigabyte | |

Binary Conversion

Decimal

As humans, we use a numbering system called decimal. This numbering system is base 10 which means that each time the number is getting bigger by x10.

|10^3 |10^2 |10^1 |10^0 |

|1000 |100 |10 |1 |

Note: This is the decimal / denary numbering system that we use.

Binary

Computers use a numbering system called binary. This numbering system is base 2. The reason why computers use binary and base 2 is that it is easier to represent. For example we can represent a positive and negative charge quite easily using circuits.

1 = on or positive

0 = off or negative

Conversion guide Decimal to binary

The number: 5

1. Draw your 8 bits binary number column

128 64 32 16 8 4 2 1

0 0 0 0 0 1 0 1

2. Now we are going to ask, will the number 128 fit into 5? If it doesn’t we put a 0

3. Will 64 fit into fit into 5? It doesn’t put a 0

4. 32? No, 0

5. 16? No, 0

6. 8? No, 0

7. 4? Yes 5 – 4 = 1

8. 2? No,

9. Will 1 fit into 1, yes but a 1

Use the example above to complete the binary conversion below.

Worksheet

Binary Conversion Cross-Number 1

|1 | |

|lower() | |

|upper() | |

|title() | |

|swapcase() | |

|capitalize() | |

The output: BOB

Can you remember what concatenation is? If not, do a quick search online and make a note of it.

Task 5 - Restaurant Tip

Write a program.

Two people eat dinner at a restaurant and want to split the bill.

The total comes to £100 and they want to leave a 15% tip. How much should each person pay?

Harder: make the program ask how many people there are, what percentage the tip should be and how much the bill comes to.

Save this as Restaurant tip.

Task 6 - Restaurant Tip

The grade boundaries for a test are:

U - 0

D – 40

C – 50

B – 60

A – 70

Write a program that asks for a mark and then says what grade it is worth.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download