Physical components of a computer system. Includes internal components EG hard drive, sound card and external components EG printer, speaker
Software
Program code, sequences of instructions which are executed to perform a task
Application software
Programs that complete a specific task for the user EG word processor, web browser, spreadsheets
System software
Operates, controls and maintains the computer and its components. Includes operating system, utility programs, library programs, and translators
Operating system
Allows user to control the computer by providing virtual machine to hide the true complexity. Also manages and controls computer resources EG memory management, processor scheduling, interrupt handling
Interrupt
Signal sent to processor when an important event occurs
Utility programs
Housekeeping tasks EG data backup, defragmenting hard drives, data compression and encryption
Library programs
Contain useful functions that are frequently used by a program. Can be used by programmers to simplify program development processes. If making use of one, programmer must import it within their program code
Translators
Software that translates between different types of language. 3 types: compilers, assemblers and interpreters
Development of programming languages
1. Limited speed and memory of early computers forced programmers to write programs with low level languages which directly manipulated processor, required a lot of effort to code, and were error prone
2. High level languages allow instructions to be communicated to a processor making programming easier
Low level languages
Programs written are specific to the processor and directly affect the processor. 2 types: machine code and assembly language
Machine code
Only uses binary, making programs long and unreadable for humans therefore prone to errors and difficult to debug. Directly manipulates processor so very powerful and programmers are not constrained, and no need to translate before executing so useful for embedded systems and real time applications where speed is important
Assembly language
Made to simplify writing programs. Uses mnemonics EG ADD, MOV in place of binary machine code so is more compact and less error prone
Each assembly language instruction has a 1-to-1 correlation to a machine code instruction
High level languages
Not platform specific but must be translated by compiler or interpreter before they can be executed. Dont use binary or mnemonics, use english instructions and mathematical symbols so much easier to learn and understand and debug
High level languages
Allow use of built-in functions which save time programming
Have named variables, indentation and commenting which makes it easier to debug
Imperative HLL
Formed from instructions that specify how a computer should complete a task
Declarative programming
Describes what a computer should do
Translators
Translate high level languages or assembly language to machine code so they can be executed. 3 types- assembler, compiler, interpreter
Assembler
Translates assembly language into machine code. Because they have 1-to-1 relationship it is quick and straightforward. Assemblers are platform specific so must exist for each different type of processor
Compiler
Translated HLLs into machine code. Take high level program as their source code, check for errors then translate the entire program at once. If source code contains errors it will not be translated. Produce machine code so are platform specific. Once translated, compiled program can be run without requirement of any other software- not the case with interpreters
Interpreter
Translate HLLs into machine code line by line. Have procedures that can be used to translate each kind of program instruction. Rather than checking for errors before translation, they check for errors as they go so a program with errors can be partially translated until error is reached. Once translated, program source code and interpreter must be present- poor protection of source code compared to compilers so original code is difficult to extract
Source code
Input of a translator.Assembly language code for assemblers, high level language code for compilers and interpreters
Object code
Translators output, produced from the source code
Intermediate language
When compilers dont produce machine code straight away. Often bytecode, and allows for platform independence
Compilers that use intermediate language
1. Translate HLL code into intermediate language EG bytecode and then use virtual machine to execute bytecode on different processors
2. Each processor instruction set has its own virtual machine
3. Using intermediate language allows interpreter to translate source code just once while still being able to execute translated code with variety of processors
Half adders
2 inputs, 2 outputs, 2 logic gates
Full adders
3 inputs, 2 outputs
Edge triggered d type flip flop
Logic circuit which can be used as a memory unit for storing the value of a single bit. Has 2 inputs, one for data and one for clock signal and one output, which holds the value for the stored bit. The clock signal is generated by the computer and alternated between 0 and 1 at a set frequency. The value of the stored bit is set to the value of the data input with each change of the clock signal. The clock can be used to synchronise multiple flip flops when they form a larger system EG shift register