Programming notes

?
  • Created by: loupardoe
  • Created on: 03-01-17 16:00
  • algorithms- sets of rules that define a solution to a problem
  • can be expressed in many ways
  • typically as a flowchart or in pseudocode
  • flowchart- a diagrammatic representation of the data flow and structure for the solution
  • pseudocode- structured form of English used to define the steps needed to solve a problem

Programming languages

machine language

  • software has to be provided to the processor in the form of machine code
  • stream of binary bit patterns that represent the instructions that are to be carried out
  • binary bit patterns are decoded by the processor's logic circuits
  • they are then executed
  • low level code- it works at the level of the computer hardware
  • difficult and time-consuming
  • each operation has to be defined
  • each machine instruction causes the processor to carry out just one operation
  • opcode- tells the processor what to do
  • operand- tells the processor what to do it to
  • difficult to remember all the bit patterns and what they do

assembly language

  • low level
  • each instruction causes just one processor operation
  • uses mnemonics to represent instructiond
  • programmer doesn't have to remember all the bits
  • software called an assembler translates the mnemonic into the machine code bit pattern that the processor needs

high level languages

  • do not have the same one-to-one correspondence between commands and machine code instructions as assembler
  • a command may represent several machine code instructions
  • we can usually multiply two numbers together in one command
  • at machine level this is not possible- has to be done by repeated addition
  • have to be turned into the binary instructions the machine can understand- translation
  • compiler- converts the whole code into machine code before running it
  • interpreter- converts the code one instruction at a time, running each instruction before translating the next
  • source code- code written by the programmer
  • a compiler translates source code into object code in machine language
  • object code runs independently of the source code and translator
  • an interpreter does not create object code
  • the source code must be translated each time it is run
  • interpreted languages need the source code and translator present every time the code is run
  • assembler- precise and direct instructions into the computer hardware, difficult to code, limited range of commands available
  • compiler- not needed on target machine, code runs quickly, difficult for others to modify without access to the source code, initial compilation can be slow, errors are generated for all the code at once, difficult to debug
  • interpreter- executes one statement at a time, easy to debug, can be…

Comments

No comments have yet been made