Download presentation
Presentation is loading. Please wait.
1
A451 Theory – 7 Programming 7A, B - Algorithms
2
Learning Intentions To develop an understanding of how algorithms are used to represent computer systems and programs
3
Assessment Outcomes 7C - Explain the difference between high level code and machine code 7D - Explain the need for translators to convert high level code to machine code 7E - Describe the characteristics of an assembler, a compiler and an interpreter 7F - Describe common tools and facilities available in an integrated development environment (IDE): editors, error diagnostics, run-time environment, translators, and auto-documentation.
4
7C - Explain the difference between high level code and machine code
The processor uses something called Machine Code to perform a task. Machine Code is usually represented as Binary – this is the 1st generation of coding language. Binary Code is often difficult for a human to understand so the code is given mnemonics – short words that represent a function – for example ‘Add’, ‘Store’, or ‘Load’. – This is the 2nd generation of coding language. Humans however prefer to code in languages that are closer to English – we call these ‘High Level’ languages and these are the 3rd generation of coding language.
5
7C High and Low Level Code
Machine Code High Level Languages Processor specific: one language per processor Portable: will work on different types of architecture, won’t work on another machine machine/processor Designed with hardware in mind Designed with a type of problem in mind One assembly language command will be translated One high level program instruction will be translated into one binary instruction in machine code into several machine code instructions Translated using an assembler Translated using a compiler or interpreter
6
7D – Translating High Level code into Low LEvel
Whatever language a program is written in, it must be translated into machine code so it can run on the processor. Translators are a type of system software. There are 3 types of translator: Assemblers Compilers Interpreters High Level Code Assembly Code Machine Code Compiler or Interpreter Assembler
7
7E – Translating High Level Code into Low Level
Compiler Interpreter Translates the whole program to produce the Translates and executes one line at a time. executable object code. The object code is the version that the computer The source code is the version that the computer runs. Faster run time because the program is translated Slower run time because the program is translated once, object code is run after that. every time it is run. Customers cannot see the actual code you wrote If you distributed source code with an interpreter when you distribute the program. then customers would have your actual code. Used for distributed software. Used in development. A compiler translates a high level programming language into machine code – it compiles every line of code at the same time. An Interpreter translates a high level programming language into machine code – it translates each line of code separately. This helps programmers to debug their program and see which parts work and which do not!
8
7E Interpreters and compilers
Good for developing programs as you can execute parts of the program Have to correct all the syntax errors before you can run the program Slower execution as every line is translated before it is executed Fast execution of object code A user has to have the programming language and interpreter on their computer Once the object code is produced, it can be installed and run on any computer A user who has purchased your program can make changes and sell it on A user who has purchased your program cannot see the source code
9
7E - Assemblers The translator that converts assembly language programs into machine code.
10
7F – IDE Tools IDEs are software packages that help programmers to write code more easily. IDEs provide programmers with lots of handy tools when they are coding. While not all IDEs are exactly the same they all have similar basic tools. IDEs provide several tools that help programmers to write code easier: Colour (Syntax) Highlighting Debugging Tools Translators Auto-Indentation
11
7F – IDE Tools Colour (Syntax) Highlighting Debugging Tools
These highlight or change the colour of code as it is typed. This makes it easier for the programmer to see if their command words, data types, and programming structures have been written correctly. Debugging Tools These may show the programmer why a piece of code isn’t running – they may show the programmer the area of code that is affected Translators These translate the code line by line so that the programmer can test their code throughout development. Auto-Indentation Sometimes the IDE will put in indents inside programming structures – for example if statements or for loops in python
12
Crib – Fundamental topics
Explain the 3 generations of code Explain why humans use high level code Identify the difference between Assemblers, and Compilers/Interpreters Explain the difference between Compilers and Interpreters Explain 4 different IDE tools that make it easier to program and how they make it easier.
13
Exam Questions I have ripped off every exam question for Unit 1 – Fundamentals of Computing.. Answer all of the questions in the A, B, C folder. Self Assess them all. Get me to check them!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.