Nat 4/5 - Software Design and Development – Low Level Operations - 1 Why use Binary? It is a two state system (on/off) which makes it simple to operate, only two values need to be generated and detected. Generally 5v represents a 1 and 0v a 0. If degradation of the signal occurs (ie a slight drop in voltage) eg 5v drops to 3v, it will still be detected as a 1 Imagine how difficult it would be to represent 10 distinct voltages? There are only four rules for addition in binary compared to 100 in decimal 0 0 1 1 0 1 0 1 0 1 1 10
59
Embed
Nat 4/5 - Software Design and Development – Low Level Operations - 1 Why use Binary? It is a two state system (on/off) which makes it simple to operate,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Nat 4/5 - Software Design and Development – Low Level Operations - 1
Why use Binary?
It is a two state system (on/off) which makes it simple to operate, only two values need to be generated and detected. Generally 5v represents a 1 and 0v a 0.
If degradation of the signal occurs (ie a slight drop in voltage) eg 5v drops to 3v, it will still be detected as a 1
Imagine how difficult it would be to represent 10 distinct voltages?
There are only four rules for addition in binary compared to 100 in decimal
0 0 1 10 1 0 10 1 1 10
Nat 4/5 - Software Design and Development – Low Level Operations - 2
Decimal Arithmetic Rules
4 rules for binary arithmetic BUT 100 for decimal arithmetic
Nat 4/5 - Software Design and Development – Low Level Operations - 3
Number Systems - Decimal
We learned to count when we were very small and now we hardly remember anything about units, tens, hundreds and thousands, but we really need to understand this to understand that binary is very similar. Look at this number:-
Complete Exercise 1 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 6
Binary – Positive and Negative Integers
Two’s complement is a method of representing both positive and negative numbers. The MSB (left most bit) gives the sign of the number but also contributes to its size.
MSB is 1 then number is negative, MSB is 0 number is positive. Let’s represent -55 by changing 55 to -55:
Write down column Headings
128
64 32 16 8 4 2 1
Write down number (55)
0 0 1 1 0 1 1 1
Invert Numbers
1 1 0 0 1 0 0 0
Add 1 + 1
1 1 0 0 1 0 0 1
You then calculate the number as = -128+64+8+1 = -55
Nat 4/5 - Software Design and Development – Low Level Operations - 7
Range of Positive and Negative Numbers
Range of numbers in Twos Complement Notation: The largest negative number using n bits is –2 n-1 so in 8 bits = -27 = -128 The largest positive number using n bits is +(2 n-1 –1) so in 8 bits = 27 -1 = 127 So, in twos complement, using 8 bits, the range of numbers is -128 to 127 Complete Exercise 2 and get your teacher to check the
answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 8
Real Numbers – Floating Point Representation
A real number is a number with a decimal point it in , sometimes called a floating point number. Floating-point representation is a way of representing very large or very small numbers using Scientific notation. This notation represents numbers as a base number and an exponent. For example, 234.567 in decimal could be represented as 2.34567 x 10 2, with base = 10 and exponent = 2.
Mantissa * base exponent
Floating point representation uses a mantissa and an exponent to represent a real number.
Nat 4/5 - Software Design and Development – Low Level Operations - 9
Real Numbers
An example of floating point representation in decimal is shown below:
The exponent represents the range of the number. The mantissa represents the precision/accuracy of the
number. Given a fixed number of bits in a register, there are decisions
that need to be made as to how many bits will be allocated to the mantissa and how many bits allocated to the exponent. (A register is a fixed size of eg 16/24/32 bits and cannot be altered).
Applications that deal with very large numbers, for example astronomy, are more interested in representing a big enough range of numbers, however, scientists dealing with molecular data place greater importance on precision.
Nat 4/5 - Software Design and Development – Low Level Operations - 10
A Typical Floating Point Number
This might be represented using 32 bits. 24 bits for the Mantissa, the remaining 8 bits for the Exponent.
Mantissa Exponent
24 bits 8 bits The more bits we use for the exponent, the larger
the range of numbers available, but at the expense of precision. We still only have a total of 232 numbers that can be represented.
Nat 4/5 - Software Design and Development – Low Level Operations - 11
A Typical Floating Point Number
If we take the value 11010.11011011101, we float the point to the far left, note the number of places it floated and this becomes the exponent. All the bits of the number are then stored as the mantissa.
So, to represent 11010.11011011101 as a floating point number using mantissa and exponent it becomes:
Mantissa Exponent 1101011011011101 0101 The mantissa holds all the bits of the number, the
exponent holds the number of places the point floated to the left hand side, in this case 5 (0101 in binary). [Note: Assumes all numbers are positive.]
Complete Exercise 3 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 12
Representing Text: ASCII
The set of characters that can be represented by the computer is known as the character set. Many computers have the flexibility of using several character sets, but we will restrict our discussions to ASCII.
ASCII – American Standard Code for Information Interchange
Nat 4/5 - Software Design and Development – Low Level Operations - 13
Representing Text: ASCII
ASCII is used to represent alphanumeric characters for data like names and addresses which are stored as strings of characters containing letters, numbers and symbols.
ASCII uses a unique 7 bit code to represent each character, giving a possible 128 different characters. It has 96 displayable characters, enough to represent a letter or symbol of the English alphabet and numeric symbols.
There are 32 special character codes known as control characters. These use ASCII values 0-31, these code do not print anything on screen but are used for control characters such as ASCII code 7 (bell) and CTRL Z (end of file).
Representing character codes in a standard way means that data can be transferred between computers easily. ASCII also has an 8-bit extended format that can represent 256 different characters used on PCs.
Nat 4/5 - Software Design and Development – Low Level Operations - 14
Nat 4/5 - Software Design and Development – Low Level Operations - 15
Representing Text: ASCII
Extended ASCII codes, this uses all 8 bits to encode 256 different characters, a sample is shown below:
Complete Exercise 4 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 16
Instructions – Machine Code
Computers only understand Machine Code. It is described as the computer’s own language and is made up of 1’s and 0’s. Machine code is different for different ‘platforms’ of computers (eg Mac or PC). The machine code for one computer will not run on a different computer. A computer program is made up of machine code instructions. An example of a machine code program is:-
10101001 10111000 10101010 11001100
10111000 10101010 11001100 00110011
Nat 4/5 - Software Design and Development – Low Level Operations - 17
High Level Languages
To run a program in a computer the program must first be loaded into RAM. Think of when you want to use a word processor, you firstly load the word processor into RAM. The processor of the computer carries out the instructions of the program in turn. Each instruction is fetched from main memory (RAM), decoded and then executed. This process continues until all instructions have been processed.
Programs are written in High Level Languages (HLL) eg Visual Basic. The four features of HLL’s are:-
• They are written in English, errors are easier to find and fix• They must be translated into machine code (computers
don’t understand HLLs)• They are designed to solve problems• They are portable (can be used on different computer
systems without alteration)
Nat 4/5 - Software Design and Development – Low Level Operations - 18
High Level Languages
1. Instructions in English - programs easy to understand, instructions are in everyday language. The instruction:picDisplay.Print area Prints area into pic box picDisplay
2. Must be Translated – each High Level Language instruction can be understood by us, but the computer only understands machine code (made up of 1s and 0s and sometimes called ‘the computers own language’). Each HLL instruction must be translated into a number of machine code instructions.
3. Designed to solve problems – programs are written to solve problems. Eg someone had the idea that it would be good to be able to find your car in a busy car park on your return to the car park. From this idea someone wrote a program to direct the driver from their current location to the location of their car using a GPS signal. So software has developed due to ideas beginning “wouldn’t it be good if…..” Can you think of any app you would want on your mobile?
4. Portable – software can be written to work on a number of different platforms, this means that irrespective of the hardware and software you have the program will still run. This means software companies can sell their software to more people, thereby increasing their profit.Complete Exercise 5 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 19
Translators
Changing a program from one computer language to another is called Translation.
There are two different types of translators - Interpreters and Compilers
Nat 4/5 - Software Design and Development – Low Level Operations - 20
Translators - Compiler
A compiler is a program. It takes an entire HLL program and translates it into Machine Code in a single operation. The original HLL program is called the Source Code. The Machine Code program produced by the compiler is called the Object Code. The compiler changes each HLL instruction into several Machine Code instructions.
Object Code runs very fast as it is in the computer’s own language.
It’s a good idea to save both the Source Code and the Object Code. The Object Code is saved as it is the version which is run. Can you think why the Source Code is saved?
It is saved in case the original program gets edited in the future.
Nat 4/5 - Software Design and Development – Low Level Operations - 21
Translators - Compiler
The Source Code is translated, in a single operation, into Object code:
The object code is not executed immediately, but can be saved separately.
Nat 4/5 - Software Design and Development – Low Level Operations - 22
Translators – Interpreter
An interpreter takes a program written in High Level Language and translates it into Machine Code one line at a time. After each line is translated the command is carried out.
Nat 4/5 - Software Design and Development – Low Level Operations - 23
Translators – Interpreter
Interpreted programs run much more slowly than compiled programs. This is because the translator must translate each instruction from HLL into machine code, one instruction at a time. This must occur for each instruction every time the program is run. There is NO object code produced by an interpreter.
Nat 4/5 - Software Design and Development – Low Level Operations - 24
Translators – InterpreterCompiler Interpreter
Run Time
Run time is fast as the code is already translated. The object code program is run so it does not need to be translated as it’s already in machine code.
Run time slower, interpreter must translate each instruction in turn, every time the program is run. Code inside a loop must be translated and executed the number of times the loop repeats. For a loop for 10 each instruction inside the loop needs translated and executed 10 times.
Ease of fixing errors
Program will not compile if it has errors. Error report is produced after it tries to compile the code. The errors must be found and fixed in the HLL code and then re-compiled. More errors could result from this.
The program will run successfully up until the error is encountered. This allows partial code to be tested and allows the programmer to see the program improve. Syntax errors are highlighted immediately allowing them to be fixed.
Nat 4/5 - Software Design and Development – Low Level Operations - 25
Translators – InterpreterCompiler Interpreter
Use of RAM
The compiler software can be removed from RAM once the code is compiled, this saves RAM in the future as only the object code program is needed in RAM to run the program.The resultant object code can be larger as RAM is not being used up storing the compiler software.
The interpreter software can never be removed from RAM, it must be present every time the program is run.
This means the resultant HLL code must be smaller as it cannot use the full amount of RAM.
When should I use each?
Use compiler for the final version of a program as it contains no errors and run time is fast.
Use when developing a program as it highlights error immediately making them easier to find and fix, and allows partial code to be run so you can see the result of coding up to that point in the program.
Complete Exercise 6 and get your teacher to check your answers.
Ask your teacher if you have to do the questions from the J Walsh book.General: KU 1-2 and PS 1Credit: KU 1-2 and PS 1-3
Nat 4/5 - Software Design and Development – Low Level Operations - 26
Representing Graphics
There are two ways of representing graphics
•Bit Mapped Graphics•Vector Graphics
Nat 4/5 - Software Design and Development – Low Level Operations - 27
Representing Graphics – Bit-mapped
Graphic images are displayed on a monitor as a collection of pixels. A pixel is a dot on screen that makes up a graphic. A bit mapped image is stored as a file of pixel data and is produced on screen at the same resolution at which it was created.
Resolution refers to the total number of pixels in the width and height of the image. A bit map is a term that is applied to a 1-bit per pixel graphic system, i.e. where images can have only two possible colour values, 1 and 0, usually black and white:
ie 1:1 mapping of pixel : bit in memory.
Nat 4/5 - Software Design and Development – Low Level Operations - 28
Representing Graphics – Bit-mapped
A simple graphic produced in a painting package, using only 2 colours, and its corresponding 8 x 8 x 1-bit representation is shown below:
Nat 4/5 - Software Design and Development – Low Level Operations - 29
Representing Graphics – Bit-mapped
As number of bits per pixel increases, number of colours increases
Using 2 bits per pixel allows 4 colours per pixel Using 8 bits per pixel allows 256 colours per pixel The number of bits used to represent each pixel is
called the colour-depth (bit-depth) and determines the number of colours per pixel
Nat 4/5 - Software Design and Development – Low Level Operations - 30
Representing Graphics – Bit-mapped
Nat 4/5 - Software Design and Development – Low Level Operations - 31
1 bit per pixel
Nat 4/5 - Software Design and Development – Low Level Operations - 32
4 bits per pixel
Nat 4/5 - Software Design and Development – Low Level Operations - 33
8 bits per pixel
Nat 4/5 - Software Design and Development – Low Level Operations - 34
16 bits per pixel
Nat 4/5 - Software Design and Development – Low Level Operations - 35
Representing Graphics – Bit-mapped
Advantages of bit mapped graphic representation a bit mapped image can be manipulated at the pixel level.
Thus a designer may apply particular colour values to a selected pixel area to produce shading or textured effects;
it is possible to create a wider range of irregular shapes and patterns by simply deleting pixels anywhere on the image.
Disadvantages of bit mapped representation requires large amounts of storage space; image becomes course (jagged) when scaled; does not take advantage of resolutions that are higher than
the resolution of the image. Resolution dependence means graphic takes it resolution at the time of creation.
This is an example of a bit-mapped image:
Nat 4/5 - Software Design and Development – Low Level Operations - 36
Calculating Storage Required for a Bit-mapped Graphic
A black and white graphic uses only 1 bit per pixel to store the colour of the pixel.
If an image is 6 inch x 5 inch and it has a resolution of 600 dpi, then we calculate the storage required using the formulae:
inches * inches * dpi * dpi = 6 * 5 * 600 * 600 bits= 10800000 bits / 8 to get bytes= 1350000 bytes / 1024 to get KB= 1318.36 KB/ 1024 to get MB= 1.29 MB Complete Exercise 7 and get your teacher to check
the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 37
Vector Graphics
Vector graphic representation does not represent the image pixel by pixel. Instead, it stores a description of the objects that make up the image, ie the objects attributes. For example, if an image contains a coloured circle and a pattern filled square then these object descriptions could take the form shown below:
Nat 4/5 - Software Design and Development – Low Level Operations - 38
Vector Graphics
Advantages of vector graphic representation they do not lose their image quality on scaling, so can
be enlarged without losing resolution requires less storage space than a bit mapped image; they can be edited by changing their attributes at the
"object" level, thus allowing the user to reposition, scale and delete entire objects, or groups of objects, with ease;
objects can be grouped/layered to form larger objects that can then be manipulated as a single image;
these packages are ideal for drawing plans eg, an architectural drawing of a house/building, and you can use a library of objects to make this easier too
Nat 4/5 - Software Design and Development – Low Level Operations - 39
Vector Graphics
Disadvantages of vector graphic representation a bit mapped image can be manipulated at the pixel
level. Thus a designer may apply particular colour values to a selected pixel area to produce shading or textured effects;
it is possible to create a wider range of irregular shapes and patterns by simply deleting pixels anywhere on the image.
Nat 4/5 - Software Design and Development – Low Level Operations - 40
Computer Architecture
A Simple Computer System Computers are digital machines that execute
machine code programs and operate on data in binary form. By binary form we mean a representation of information as 0s and 1s.
Computer programs are simply a list of instructions that have to be carried out in a particular order.
1 An instruction is fetched from RAM 2 Processor decodes the instruction 3 Instruction is executed – the ALU may be
involved here if calculations/logic decisions need to be made (eg AND, OR, NOT, IF … THEN etc) .
This is far removed from the games and application programs with which you are familiar but all programs are run in this manner.
Nat 4/5 - Software Design and Development – Low Level Operations - 41
Computer Architecture
A simple computer consists of the following components as represented in this block diagram:
Processor Memory Input/Output Devices Backing Storage Communication Channels
Input devices include the keyboard and mouse and can be used to supply input to the processor.
Output devices include the monitor and printers and these can be used to supply output from the processor.
Input and output devices are often known as peripheral devices.
Nat 4/5 - Software Design and Development – Low Level Operations - 42
Computer Architecture – The Processor
The processor is the main component of the computer itself. Within the processor are the control unit, the arithmetic and logic unit (ALU) and registers.
Computer programs are simply a list of instructions that have to be carried out in a particular order. The control unit fetches each instruction, in turn, from the main memory (they are held in registers within the processor). It then decodes and executes each instruction. The ALU is involved if it is necessary to perform arithmetic calculations or make logical decisions. This is far removed from the games and application programs with which you are familiar but all programs are run in this manner.
Nat 4/5 - Software Design and Development – Low Level Operations - 43
Computer Architecture – The Processor
The processor is where instructions are processed and computations are carried out.
The communication channels allow data and control signals to be communicated between the main components of the computer.
The Processor typically consists of 3 components: Control Unit, ALU and registers.
Control Unit The main functions of the control unit are:1 to control the timing of operations within the
processor2 to send signals that fetch instructions from main
memory3 to decode these instructions4 to carry out these decoded instructions
Nat 4/5 - Software Design and Development – Low Level Operations - 44
Computer Architecture – The Processor
Arithmetic and Logic Unit (ALU) - The main functions of the ALU are:1. to perform arithmetic calculations (addition,
subtraction, multiplication, division)2. to perform logic functions e.g. IF…THEN, use of
AND OR NOT < > = <> Registers These are very fast temporary storage locations on
the processor, they provide temporary storage places for data being manipulated. This data could be an address in memory, data being read or written, or instructions waiting to be decoded.
Complete Exercise 9 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 45
Computer Architecture – Memory
Main memory stores programs and data that the user is currently using. Instructions have to pass into the processor to be carried out. The processor can’t store all the instructions it needs inside it so main memory is used. Memory is organised into consecutive memory locations, each having its own unique address, and each capable of storing one byte of information (the amount needed to store a single letter eg A). Main memory is just a collection of memory chips.
Nat 4/5 - Software Design and Development – Low Level Operations - 46
Computer Architecture – The Processor
The main memory of a computer is made up of ROM and RAM.
Read Only Memory (ROM) is used to store a small part of the operating system called the bootstrap loader. When your computer is switched on, the bootstrap loader examines the backing storage devices to find the operating system. Once found it is loaded into RAM.
ROM has the following features: 1 data in ROM is permanently stored onto a
microchip 2 ROM is read-only so it cannot be changed 3 data on ROM is not lost when the computer is
switched off.
Nat 4/5 - Software Design and Development – Low Level Operations - 47
Computer Architecture – The Processor
Random Access Memory (RAM) is the largest part of the main memory. This is where the operating system is stored; it also holds all programs and data. You can purchase additional RAM chips and install them in your desktop/laptop computer.
RAM chips - to improve system performance they can be added to your computer, increasing the ram from, say, 2 GB to 4 GB.
RAM has the following features: 1 the data in RAM is read/write so it can be changed 2 all data stored in RAM is lost when then computer is
switched off 3 RAM stores the programs and associated data of the
programs currently in use Complete Exercise 10 and get your teacher to check
the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 48
Computer Architecture – Storage
A computer is called a two-state system as it uses only two digits for all processing and storage. These are the digits 0 and 1 - called BINARY. Think about binary as being a light bulb that is either ON or OFF, ie, it has two states!
Bulb On1
Bulb Off0
Storage refers to the media and methods used to permanently store data, this enables data to be loaded in the future.
Nat 4/5 - Software Design and Development – Low Level Operations - 49
Computer Architecture – Storage
1 byte can store 1 character (ie, a letter, number or symbol).
When we studied ASCII code we understood that a character needed 8 bits to store it, so the capital letter A needs 8 bits to store it:
128 64 32 16 8 4 21
A = 65 = 0 1 0 0 0 0 01
How many characters are needed to store this sentence?
Nat 4/5 - Software Design and Development – Low Level Operations - 50
Computer Architecture – Storage
The smallest form of storage in a computer is a bit, this is a binary digit, either 1 or 0. This table shows you how bytes are organized:
Nat 4/5 - Software Design and Development – Low Level Operations - 51
Computer Architecture – Storage
To help you to understand the concept of the amount of storage, study this table:
Complete Exercise 11 and get your teacher to check the answers
Nat 4/5 - Software Design and Development – Low Level Operations - 52
Computer Architecture – Storage
An interface is a hardware device that is needed to allow the processor to communicate with an external or internal device such as a printer, modem or hard drive. Sometimes the interface is a board in the computer and sometimes it is a connection to a port.
The reason that an interface is required is that there are differences in characteristics between the peripheral device and the processor. Those characteristics include:
data conversion speed of operation temporary storage of data.
Nat 4/5 - Software Design and Development – Low Level Operations - 53
Computer Architecture – Storage
Data conversion The commonest example of data conversion is when the
peripheral accepts an analogue signal that must be converted into digital for the processor to comprehend it. A modem is typical of this, as shown below:
Speed of operation The speed of operation of peripheral devices tends to be in
terms of pages per minutes, frames per second or megabytes per second; however, the processor works at a rate in line with its internal clock, which is much faster. The speed of the internal operations is measured in gigahertz and a processor will typically work at 2.8 GHz, i.e. 2800,000,000 cycles per second. This difference in the speed of operation between the processor and devices requires an interface between the two devices as the processor can deliver data much faster than the peripheral device can handle.
Nat 4/5 - Software Design and Development – Low Level Operations - 54
Computer Architecture – Storage
Data storage In older computer systems the processor would stand idle
while the printer was finishing a print job. One way around this problem is to have the data held temporarily in transit between the processor and the printer. Interfaces are used to hold this data, thus releasing the processor; the data is held in a ‘buffer’. Keyboard characters entered by the user are stored in the keyboard buffer while they are being processed.
One of the important considerations when purchasing a portable CD-RW drive is the type of interface it uses. There are four interface options for portable drives: parallel port, PC card, USB 2.0/3.0 and IEEE 1394 Firewire. Most users favour USB 2.0 and Firewire because of their high connection speeds and flexibility.
Types of interfaces include IDE, SCSI, serial, parallel, PCI, USB and Firewire.
Complete Exercise 12 and get your teacher to check the answers.
Nat 4/5 - Software Design and Development – Low Level Operations - 55
Computer Architecture – Buses
A BUS is a channel along which data/control signals flow. These channels are electronic pathways (sets of wires).
Nat 4/5 - Software Design and Development – Low Level Operations - 56
Computer Architecture – Buses
A BUS is a channel along which data/control signals flow. These channels are electronic pathways (sets of wires).
There are 3 main buses that you need to know:• Data Bus • Address Bus• Control Bus
Nat 4/5 - Software Design and Development – Low Level Operations - 57
Computer Architecture – Data Bus
The data bus is the main pathway along which data flows between the Processor and Memory
The Data Bus is a bi-directional (two way) bus as data can travel from the processor to memory or from memory to the processor.
The wider the Data bus the more data can travel along it in one clock cycle ... thus increasing the throughput of the processor.
The width of the data bus is known as the word length.
Nat 4/5 - Software Design and Development – Low Level Operations - 58
Computer Architecture – Address Bus
All addresses for read or write operations are generated by the processor and are placed on the address bus.
The Address Bus is uni-directional (one way) only - always from the processor
The wider the Address bus the more memory that can be addressed. This has NO EFFECT on throughput)
Note 1: if a system has an 8 bit address bus, then this allows 28 (256) different locations to be addressed within memory. However, in reality address bus widths are much greater, they have the potential to address more memory than the system actually has built in. Generally this happens because of the cost of RAM chips making the systems cheaper to buy.
Note 2: it is ideal in a computer if the data bus width (ie, the amount that can be stored in each memory location) is the same width as the processor word length (size of the data paths within the processor). This will allow it to load instructions/data from memory in a single cycle/operation, allowing it to process work more effectively.
Nat 4/5 - Software Design and Development – Low Level Operations - 59
Computer Architecture – Address Bus
The Control Bus is of a set of control lines which work independently, controlling all processor operations.
Control line Function of the control line Read line controls a read from memory operation Write line controls a write to memory operation Clock constant pulse - controls timing of processor
operations Reset resets control lines and processor registers Interrupt an I/O device/sys software routine needs
processor time Increasing the clock speed on the control bus will increase
the throughput of the processor, all operations will be carried out faster.
Processor Internal Buses The processor needs its own means of transferring data e.g.
between the ALU and registers and vice-versa. It also has to route signals from the Control Unit to its various internal components.
Complete Exercise 13 and get your teacher to check the answers.