Section 4: Hardware and Software Flashcards
Chapter 21:
*What was the first machine designed to fight the Enigma cipher?
The Bomba Kryptologiczna.
Polish Invention given to the British in September 1939, when Germany invaded.
Chapter 21:
*What was the machine credited for breaking the Enigma cipher?
What month and year was Enigma officially broken?
The Bombe.
Designed by Alan Turing as an adaptation to the Bomba Kryptologiczna.
Created first in Bletchley Park
Enigma was broken in July 1941.
Chapter 21:
*What was Colossus?
Colossus was machine used to break the Lorenz cipher.
Created in Dollis Hill by Tommy Flowers with a bit of help from Alan Turing.
With the creation of Colossus, the Lorenz Cipher was broken in just 4-6 weeks.
Chapter 21:
What is the name of the lowest level Programming Language?
Machine Code.
Composed of 1s and 0s. (Binary)
Chapter 21:
What are the two components for a machine code instruction?
Operation Code (Opcode) Operand
Chapter 21:
How many bits long is a standard Machine Code instruction?
32 bits.
Chapter 21:
What are the low level language steps to switching the values of 2 registers?
To switch the values of R1 and R2 where R1, R2, R3 are registers:
Load the value of R1 into the accumulator.
Store the value of the accumulator to R3.
Load the value of R2 into the accumulator.
Store the value of the accumulator to R1.
Load the value of R3 into the accumulator.
Store the value of the accumulator to R2.
Chapter 21:
What are the high level language steps to switching the values of 2 variables?
To switch the values of x and y where x, y are variables:
x, y = y, x
Chapter 21:
When Assembly Language was first introduced, what were the benefits to it?
Easier to read, write and fix than Machine Code.
Chapter 21:
When Assembly Language was first introduced, what were the drawbacks to it?
Every stage still had to be broken down and fed to the computer in an abstracted way.
Chapter 21:
What are the 8 main Assembly Language instructions?
LDA - Load the value of the given location to the accumulator.
STO - Store the value in the accumulator to the given location.
ADD - Add the value of the given location to the value of the accumulator (and store in the accumulator).
CMP - Compare the values of the given location, and the accumulator.
BLT - Jump to given location if the accumulator had the lesser value (used with CMP).
BGT - Jump to given location if the accumulator had the greater value (used with CMP).
JMP - Jump to the given location.
STOP - Stop the program.
Chapter 21:
What was the first high level programming language to release?
*When?
*By Who?
Formula Translation (FORTRAN).
Released in 1957.
Developed by IBM, in a small team led by John Backus.
Chapter 21:
*What were some of the first high level programming languages?
FORTRAN (Formula Translation) [1957]
COMTRAN (COMmercial Translator) [1957]
ALGOL 58 (ALGOrithmic Language) [1958]
COBOL (COmmon Business Oriented Language) [1959]
BASIC (Beginner’s All-purpose Symbolic Instruction Code) [1964]
Chapter 21:
What are the three categories of High Level Languages?
Procedure-Oriented Language.
Logic-Oriented Language.
Object-Oriented Language.
Chapter 21:
What is a Procedure-Oriented Language?
High level language category;
Also known as imperative high level language;
Programming language that focuses on what to do, not how to do;
Made up of commands that map to multiple machine level instructions.
e.g. x, y = y, x
(rather than R3 = R1, R1 = R2, R2 = R3).
Examples include: Fortran, Basic.
Chapter 21:
What is a Logic-Oriented Language?
High level language category;
Programming language that is comprised of logical sentences.
Examples include: Prolog, and SQL languages.
Chapter 21:
What is an Object-Oriented Language?
High level language category;
Object-Oriented programming languages are based on “objects”.
Objects contain data in the form of fields/attributes/properties.
Examples include: Python, C++, JavaScript.
Chapter 21:
What are the advantages to using High Level Languages, over Low Level Languages?
Much easier to learn.
Easier and faster to write.
Easier to understand, debug, maintain.
Not machine-specific. High Level Code can be ported to different machines.
Libraries allow for quick and easy use of complex modules.
Chapter 21:
What are the disadvantages to using High Level Languages, over Low Level Languages?
The CPU can only handle Machine Code, so High Level Languages must be converted down more. This means slower performance.
High Level Languages give you less control of the CPU. In Low Level Languages, you can manipulate registers, and be more efficient with storage.
Chapter 22:
What are the three main Programming Language Translators called?
Assembler.
Compiler.
Interpreter.
Chapter 22:
What is an Assembler?
An Assembler converts Assembly Language to Machine Code.
Chapter 22:
What are the names of the input and output of a Programming Language Translator?
Input: Source Code (Original that has been written)
Output: Object Code (Machine Code)
Chapter 22:
What is the name of the Programming Language Translator that converts Assembly Language to Machine Code?
Assembler.
Chapter 22:
What is a Compiler?
A Compiler converts a High-Level Language into Machine Code.
Chapter 22:
What is the name of the Programming Language Translator that converts a High Level Language to Machine Code?
Compiler.
Chapter 22:
How does a Compiler Translate Code?
A Compiler uses Source Code as an input.
The Source Code is scanned several times, each performing different checks and building up tables of information.
The Object Code will then be finalised, where you can save and run it without further presence of the compiler.
Chapter 22:
What is an Interpreter?
An Interpreter converts a High-Level Program into Machine Code instructions line by line.
Chapter 22:
What errors are checked before the program runs in an interpreter?
Syntax errors.
a = 1
b = 2
c = a + b
print( a, “+”, b, “=” c
(Missing closed bracket)
Chapter 22:
What errors are not checked before the program runs in an interpreter?
Runtime errors.
a = 1
b = 2
print( a, “+”, b, “=” c )
(c is not defined)
Chapter 22:
What does an interpreter do when a program with a syntax error is run?
Scan all lines checking syntax.
When the error is found, call the error.
(before the program runs).
Chapter 22:
What does an interpreter do when a program with a logical error is run?
Scan all lines checking syntax.
Run the program line by line.
When the error is found, crash the program and report the error. (Unless the error is caught in a try-catch).
Chapter 22:
What do most new interpreters use to increase execution efficiency?
Bytecode.
Chapter 22:
What is Bytecode?
Low-Level Compilation of a High-Level Program.
High-Level enough that it can be ported easily.
Can be interpreted much quicker than a standard High-Level Language.