Unit 4 - Hardware and Software Flashcards
What is Hardware?
The physical, tangible parts of the computer and its input, output and storage devices.
What is software?
All of the programs that make the computer function
What are the two main types of software?
System software.
Application software.
What are the different types of system software?
Operating systems.
Utility Programs.
Library Programs.
Translators.
What are the different types of application software?
General Purpose.
Special Purpose.
What is the role of System software?
System software is required to run and manage the computerβs hardware and application programs.
What are some tasks that system software may do?
Allocating jobs to the processor.
Maintaining security and checking for viruses.
Software installation.
Translating program code into machine code.
What is an operating system?
An OS forms a bridge between the physical hardware of a computer and the user or application software.
A user cannot communicate directly with computer hardware.
What are some examples of operating systems?
OS examples include Windows, Mac OS, Linux and Android
What are the functions of an operating system?
Memory management
Processor scheduling
Backing store management
Peripheral management of IO devices
What is utility software?
Utility software is a type of software that helps users manage, maintain, and optimize their computer systems. It includes tools such as antivirus, file compression, disk cleaner, and system optimizer.
What is an example of a utility program?
It includes tools such as antivirus, file compression, disk cleaner, and system optimizer.
What is a library?
A library is a collection of pre-compiled routines that can be used by other programs.
For example in python you can use libraries such as random and turtle.
What is the extension given to operating system library files?
In Windows, library files are given the extension: .dll
What is machine code?
Machine code is the lowest level of instruction comprising pure binary
All computer instructions need to be converted into machine code.
What is a translator?
A translator is used to translate code written in assembly language or other high level code into machine-code
What are the three types of translators?
Assemblers
Compilers
Interpreters
What is an assembler?
Assemblers translate assembly language into machine code
Typically, one assembly code instruction is translated into one machine code instruction
Each type of processor has its own assembly code and assembler program
What is a compiler?
Compilers translate high-level language programs into object code (machine code) which can be saved and run whenever needed, without the compiler having to be present. They translate the entire source code into machine code before execution.
What is an interpreter?
An interpreter is a program that directly executes instructions written in a high-level programming or scripting language without converting them into machine code. They process the source code line-by-line, translating and executing each statement sequentially.
An interpreter will typically scan through a program and report syntax errors
Once these are removed, it will execute instructions up to the point where it encounters an error.
What is application software?
Applications software is used to carry out tasks on a computer, such as writing an email.
What are the different types of application software?
General Purpose
Special purpose
Off-the-shelf
Bespoke
What is general purpose software?
General purpose software packages can be used for a range of generic tasks
These include:
Word processors β for letters, posters or textbooks
Graphics packages β for image retouching, photo editing or drawing diagrams
Spreadsheet software β for modelling, creating tables of data or lists
What is special-purpose software?
Special-purpose software performs tasks for a single, specific job
Examples include:
Payroll or accountancy software
Media players
Calendar programs
Online payment systems
What is Off-the-shelf software?
Off-the-shelf software is a pre-developed, readily available platform designed for a broad user base.
What are benefits of off-the-shelf software?
Off-the-shelf software is readily available for anyone to use
The cost is usually lower because development costs are shared among all the buyers
It is likely to be well-documented and well-tested
What are some drawbacks of off-the-shelf software?
You have little or no control over what features there are
It may not do exactly what you want
What is bespoke software?
Bespoke software is created to fulfil your own exact specifications
What are drawbacks of bespoke software?
This can significantly increase the cost
It may take several weeks, months or even years to develop
Complete control over the process gives you all the functionality you need
What does an Application Programming interface (API) do?
The true complexities of operations are hidden from the end user via an Application Programming Interface (API).
Users can issue commands or simply click a mouse to perform complex operations without having to know how they are carried out.
An API acts a bit like a waiter in a restaurant
You, the user, look at the menu and give the waiter (the API) your request
The waiter takes the request to the kitchen (the operating system)
The kitchen sends back the prepared dish via the waiter.
What is memory management?
A PC allows many processes to be running at the same time.
The OS allocates memory to each process.
If there is not enough memory, a program may be swapped out of memory onto disk or βvirtual memoryβ and reloaded when activated.
What is processor scheduling?
The OS Controls which programs can send data to the processor to be processed
Instructions from multiple operations are queued
The processor executes small parts of each operation in turn so that programs appear to run simultaneously
This is known as multi-tasking.
What is the scheduler?
The scheduler is the 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 in turn has use of the processor for a given time slice
Shortest job next
Priority system
What is task manager?
Windows Task Manager shows the processes that are currently running and the allocation of resources
What is backing store management?
The OS keeps track of where all files are stored on hard disk or external drives, and where space is free to be used if the user performs a save operation
Files can be listed, moved, deleted, protected from unauthorised access
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β
e.g. an βOut of paperβ message from a printer
What is the colossus?
The first programmable computer.
It was programmed using switches and plug panels.
Output was an indicator lamp panel.
Colossus Mark 1 was developed by Tommy Flowers and built at Bletchley Park in 1943
Input was a continuous loop of paper tape with 20,000 5-bit characters
What was the code used by the colossus?
The code used a Vernam-type cipher and the key changed every day
The ciphertext was read in from the paper tape
What did early computers consist of?
These early computers had limited memory, with each memory cell consisting of a vacuum tube the size of a light bulb
They had a control unit and an accumulator where instructions were carried out
They were programmed using machine code,
entered using a series of switches
Whats an opcode?
In machine code, a typical instruction holds an operation code (opcode) in the first few bits. It specifies the operation to be performed by the computerβs processor.
Whats an operand?
In machine code, a typical instruction holds an operand in the rest of the bits. In programming, operands are typically variables, constants, or values that are manipulated by operators to form expressions.
What is an instruction set?
The instruction set of a computer is all the instructions that it can understand and execute
If each instruction is held in 8 bits, with 4 bits for the opcode and 4 bits for the operand, the computer can execute 16 different instructions
The operand can be either an actual value or the address in memory where the value is held
What were the two major improvements in the development of assembly language?
Each opcode was replaced by a mnemonic which gave a clue as to what the operation did
The operand was replaced by a decimal (or hexadecimal) number
What are some advantages of assembly code?
It is much easier to write, understand and debug programs in assembly language
What are some disadvantages of assembly language?
The assembly code has to be translated into machine code by an assembler
What was the first high-level language?
FORTRAN
What is an imperative high level language?
An imperative high-level language consists of commands for the computer to perform.
What is a declarative language?
A declarative language focuses on what the program should do without listing the steps needed to achieve the result.
For example SQL
Why do we use high level languages?
So that the programmer can think and code in terms of algorithms rather than worrying about how the computer will execute each tiny step.
What are advantages of high-level vs low-level languages?
Much easier and faster to write, debug and maintain programs
Different high-level languages have been written specifically for different types of problem
High-level language programs are portable β a program written for one type of computer can be recompiled for a different type of computer
What are disadvantages of high-level vs low-level languages?
The object code (compiled or interpreted code) may run slower than assembly code or machine code
The object code may occupy more space in RAM β which can be a problem in embedded systems with a small amount of memory
Most high-level languages do not have statements to allow the programmer to manipulate individual bits β essential in some applications, e.g. device drivers
What is the source code?
The assembly code program
This is the input to the assembler.
What is the object code?
The output is the machine code instructions produced by the assembler, called the object code
The object code can be saved and run whenever needed.
What are uses of assembly code?
Assembly code is used when a program needs to execute as fast as possible, occupy as little space as possible or manipulate individual bits and bytes.
Typical uses include embedded systems, real-time systems, sensors, mobile phones, device drivers and interrupt handlers.
The object code, rather than the source code, is saved and run when required.
What is the compilation process?
A compiler is a complex program which has several phases such as lexical analysis, syntactic analysis, and semantic analysis, going through the whole program at each stage
It produces intermediate code, optimises it, then generates the machine code
It will not generate the machine code it there are any errors in the program
What types of errors will the compiler find?
The compiler will find errors such as syntax errors or missing subroutines
When all errors of this kind have been corrected, the compiler will produce relocatable code, since it does not know the absolute addresses where the object code will be loaded
The object code can then be saved and the compiler does not need to be present to run the object code
What are some advantages of a compiler?
Once a program has been compiled, the object code can be distributed and the compiler is not needed to run the program.
The object code runs faster than interpreted code.
The object code is more secure, as machine code cannot easily be read and copied by someone wishing to modify the code and sell it as their own product.
What are some advantages of an interpreter?
An interpreter is useful in education because it allows students to program interactively using βInteractive modeβ
It is useful during development when a programmer may want to test a small piece of code without recompiling the whole program
Both compilers and interpreters are available for most high-level languages
What is bytecode?
Some compilers such as the Java compiler compile the source code into an intermediate form known as bytecode.
The bytecode file is portable, because each computer that can run Java has a JVM or Java Virtual Machine that understands bytecode and converts it into the machine code required for that particular computer
What are the six types of logic gates?
OR
AND
XOR
NAND
NOT
NOR
How does an XOR gate work?
If one, but not both, of the inputs is 1, the output is 1
Otherwise the output is 0
How does a NAND gate work?
It inverts the output of the AND gate
How does the NOR gate work?
This gate inverts the OR gate
The output is 1 only if both inputs are 0
What are advantages of NAND gates?
Using only NAND gates to build a circuit can minimise cost of production
Using as few gates as possible can speed up processing
How does a NOT gate work?
If 0 is input it outputs 1
If 1 is input it outputs 0
How does an AND gate work?
If both inputs are 1 then the output is 1
Otherwise the output is 0
How does a OR gate work?
If either input is 1 then the output is 1
Otherwise the output is 0
What is De Morgans first law?
This states that
(NOT A) . (NOT B) = (NOT A+B)
What is De Morgans second law?
This states that:
(NOT A.B) = (NOT A) + (NOT B)
What is NOT AND equal to?
OR
What is NOT OR equal to?
AND
What are the Commutative rules?
π΄+π΅=π΅+π΄
A.π΅=π΅.π΄
What are the associative laws?
(π΄.π΅).πΆ=π΄.(π΅.πΆ)
(π΄+π΅)+πΆ=π΄+(π΅+πΆ)
What are the distributive laws?
π΄.(π΅+πΆ)=π΄.π΅+π΄.πΆ
(π΄+π΅).(π΄+π΅) = π΄.π΄ + π΅.π΅ + π΄.π΅ + π΄.π΅
What are the absorption rules?
A+π΄.π΅=π΄
A.(π΄+π΅)=π΄
What is a half adder?
- A half adder has two bits as inputs (A and B) and adds the two bits and outputs two bits the sum (S) and the carry (C). It is made up of an AND and an XOR gate
What is a full adder?
A full adder has three bits as inputs one of which is the carry bit. It adds the three bits and outputs two bits the sum (S) and the carry (C). It is made up of an AND, XOR and OR gates
What are D-Type flip flops?
A flip-flop can store the value of a bit.
* D (delay)-type flip flops are used to store one bit and flip between two states:
1 and 0.
* The inputs are a control value (0 or 1) and also a clock value (0 or 1) that
changes the state at a regular rate.
* For a positive edge triggered flip-flop the output state can only change when
the clock changes from 0 to 1. If D is in the same state as it was on the
previous edge then the output is unchanged. However, if D has changed
state, the output state will change to the value of D.