06 Hardware And Software Flashcards
What is hardware?
The electrical or electro-mechanical parts of a computer
What is software?
All the programs that make the computer function
What are the two ways of classifying software?
System Software - Operating Systems and Utility Programs
Application Software - General and Special Purpose
What does system software do?
Runs and manages the computer’s hardware and application programs
Allocates jobs to processor, installs software, maintains security, peripheral management
What is the operating system?
Serves as a middle man for communication between the computers hardware and software
Windows
OS X
Linux
What does the OS do?
Resource Management - Processor scheduling, memory management, IO management, backing store management
Provision of user interface - Command Line, Menu driven, GUI
What is utility software?
Some is designed to optimise and maintain a computer system (install, uninstall software, software updates, defragment a disk)
Or
Additional common tasks (virus check, backup, restore, file compression)
What are libraries?
A collection of pre compiled routines that can be used by other programs
Most OSs have hundreds
What is machine code?
The lowest level of instructions made up of pure binary
Hard for humans to write or understand
All instructions need to be converted to it
Opcode in first few bits
Operand in the rest of the bests
What is a translator?
It is used to translate code written in assembly language or high level code into machine code
Not a utility program
What are the three types of translators?
Assemblers
Compilers
Interpreters
What are assemblers?
Translate assembly language into machine code
What are compilers?
Translate high level language programs into machine/object code which can be saved and run whenever without a compiler
What are interpreters?
Translates high level languages into an intermediate from and then executes it
No object code is produced and it will usually scan through and find syntax errors
What are some examples of application software?
Word processors
Image editors
Email clients
Internet browsers
What are general purpose software packages?
Can be used for a range of generic tasks
Word processors
Graphics packages
Spreadsheet software
What are special purpose software packages?
Performs tasks for a single specific job
Media players
Calendar programs
Online payment systems
What is off the shelf software?
Readily available
Low cost
Well documented and well tested
However
Little control of features
May not do exactly what u want
What is bespoke software?
Created to fulfil your own expectations
Complete control over the process so can do exactly what u need
Can increase costs
Can take weeks, months or years
What is an API and what does it do?
It is an application programming interface and hides the true complexities of the operation
User gives a request
API sends this to OS
Operation is carried out and shown through API
What is memory management?
OS allocates memory to each process
And if there is not enough they are swapped out of memory and into virtual memory
What is processor scheduling?
OS controls which programs can send data to the processor to be processed
Instructions from multiple operations are queued
What is processor scheduling?
Operating system module responsible for ensuring that processor time is used as efficiently as possible
What are the different scheduling algorithms?
Round robin - each process is given a time slice and takes turns
Shortest job next
Priority system
What is backing store management?
OS keeps tracks of where all files are stored and where space is free if the user performs a save operation
What is IO device management?
Communicates with I/O devices via the I/O controller, part of the CPU
Checks that a required output device is switched on and ready to receive data
Deals with processor interrupts (Out of paper message from printer)
What is an instruction set?
All the instructions that a computer can understand and execute
The operand can either be an actual value or the address in memory where the value is held
What is assembly language?
Each opcode was replaced by a mnemonic which gave a clue to what the operation did
Operand was replaced by a decimal or hexadecimal number
Still one to one correspondence between assembly language and machine code instructions
What are the advantages and disadvantages to assembly language and machine code?
Much easier to write, understand and debug
Has to be translated into machine code by an assembler
What are imperative and declarative high level languages?
Imperative - Commands for the computer to perform (Python)
Declarative - Focuses on what the program should do without listing the steps needed (SQL)
What is a high level language?
Implies that the programmer can think and code in terms of algorithms rather than worrying about how the computer will execute each tiny step
Has to be translated into machine code before being executed
(Pascal, FORTRAN, Python)
This is an example of abstraction
What are the advantages of high level languages?
Easier and faster to write debug and maintain
Portable so can be written for one computer and recompiled for another
What are the disadvantages of high level languages?
Compiled or interpreted code runs slower than assembly or machine code
Occupies more space in RAM
Do not have statements to manipulate individual bits
How is assembly code translated into machine code by an assembler?
One assembly code instruction is translated into machine code by an assembler
Each type of processor has its own type assembly code and assembler program
What is source code and what is object code?
Source code is the assembly code program and the input to the assembler
Object code is the machine code instructions produced by the assembler and can be saved and run whenever needed
When is assembly code used?
When a program needs to
execute fast
occupy as little space
manipulate individual bits
Typically used for embedded systems, phones and sensors
The object code is saved and ran whenever needed
What is the compilation process of a compiler?
Several phases such as lexical analysis, syntactic analysis and semantic analysis
It produces intermediate code optimises it then generates machine code
Will not generate it if there are errors
What types of errors will the compiler detect and what will it do once errors are corrected?
Syntax errors or missing subroutines
After errors have been corrected it will produce relocatable code as it doesn’t know the address where the code will be loaded
What are the advantages of a compiler?
After being compiled the object code can be distributed without the compiler
Object code is faster than interpreted code
Object code is more secure as it cannot be easily read and copied by someone
Available for most types of high level language
What are the advantages of an interpreter?
Useful in education as it allows students to program interactively
Useful during development if you want to test a small bit of code and not the whole thing
Available for most high level languages
What is byte code?
Some compiler compile source code into an intermediate form called byte code
It is portable
How is byte code used?
Once it has been translated into machine code it is retained for the next time so the translation doesn’t have to be done again
What are logic gates?
Simple circuits made up of switches that can only be ON or OFF
What are the six types of logic gate?
NOT, AND, OR, XOR, NAND, NOR
What is a NOT gate?
If 0 is input it outputs 1
If 1 is input it outputs 0
What is an AND gate?
If both inputs are 1 then the output is 1
Otherwise the output is 0
What is an OR gate?
If either input is 1 then the output is 1
Otherwise the output is 0
What is an XOR gate?
If one, but not both, of the inputs is 1, the output is 1
Otherwise the output is 0
(Or with curved line before it)
What is a NAND gate?
It inverts the output of the AND gate
And with dot on end of it
What is a NOR gate?
This gate inverts the OR gate
The output is 1 only if both inputs are 0
(Or with dot on end)
How can any input be turned into one using a logic gate?
Use a NAND or NOR function
How is Boolean algebra written?
Line above = NOT
Dot = AND
+ = OR
What is De Morgan’s first law?
¯A”• ¯B=¯(A+B)
(NOT A) AND (NOT B) = NOT A OR B
What is De Morgan’s second law?
¯(A•B)=¯A+¯B
NOT A AND B = (NOT A) OR (NOT B)
How do implement De Morgan’s laws?
Complement both terms in the expression
Change AND to OR and OR to AND
Invert the result
E.g. ¯P+¯Q= ¯(P • Q)
¯P • ¯Q = ¯(P “+ “ Q)
(NOT P) OR (NOT Q) = NOT P AND Q
(NOT P) AND (NOT Q) = NOT P OR Q
What is commutative rule?
X AND Y = Y AND X
Same both ways round
What is the associative rule?
X AND (Y AND Z) = (X AND Y) AND Z If there are three values with the same logic gate you can do any two before the other. Order doesn’t matter
What is the distributive rule?
X AND (Y OR Z) = X AND Y OR X AND Z Expand the brackets
What is the absorption rule?
X OR (X AND Y) = X X AND (X OR Y) = X