Unit 1 - Preliminaries and Introduction to Computer Systems Flashcards
What is a computer?
A computer is, conceptually at least, a very simple machine that can store information, and carry out sequences of simple instructions, specified in the form of a computer program. These programs operate on stored data and inputs (e.g. provided by a user) to give outputs. Programs are collectively known as software (as opposed to the hardware, i.e. the physical electronics making up the computer).
What are the abstract layers of a computer?
Users, Applications, Software & Hardware
What is the Von Nuemann model?
The von Neumann architecture—also known as the von Neumann model or Princeton architecture—is a computer architecture based on a 1945 description by the mathematician and physicist John von Neumann and others in the First Draft of a Report on the EDVAC. That document describes a design architecture for an electronic digital computer with these components:
- A processing unit that contains an arithmetic logic unit and processor registers
- A control unit that contains an instruction register and program counter
- Memory that stores data and instructions
- External mass storage
- Input and output mechanisms
What is the CPU control unit?
The Control Unit (CU) is generally a sizable collection of complex digital circuitry interconnecting and directing the many execution units (i.e. ALU, data buffers, registers) contained within a CPU. The CU is normally the first CPU unit to accept from an externally stored computer program a single instruction (based on the CPU’s instruction set). The CU then decodes this individual instruction into several sequential steps (fetching addresses/data from registers/memory, managing execution ([i.e. data sent to the ALU or I/O]), and storing the resulting data back into registers/memory) that controls and coordinates the CPU’s inner works to properly manipulate the data. The design of these sequential steps is based on the needs of each instruction and can range in number of steps, the order of execution, and which units are enabled.
What are all modern ‘stored-progam’ computers based on?
Machine instructions manipulate data held in memory, and can,for example:
- add two data items together;
- test whether a data item is 0.
A computer stores a program and its associated data (x, y and result, for example) in memory. This is the basic idea behind the von Neumann architecture on which all modern (‘stored-program’) computers are based.
What is the program counter?
A computer must be able to keep track of the execution of a program. In particular at any time it must know:
- which instruction is currently being executed;
- which memory location is used to store the address of the next machine instruction to be executed.
This is achieved using a special memory location called the program counter. The contents of the program counter indicate the location of the next instruction to be executed (every memory location has a unique numerical address). Everything has to be explicitly stated – a computer has no intelligence; it is simply a machine following instructions.
What are bits?
Computers store and process data in the form of sequences of ones and zeros, where each one or zero is called a bit (the term is derived from binary digit). That is, a bit is either a 0 (zero) or a 1 (one).
A bit is the smallest unit of information. The 1 or 0 can be thought of as ‘yes or no’, ‘on or off’, or ‘true or false’, depending on the context.
What is a byte?
In computers, bits are typically organised in groups of eight, where a sequence of eight bits is usually known as a byte (a byte has 256=28 possible values). Sometimes a byte is referred to as an octet.
Half a byte (4 bits) is sometimes called a nibble (many Computer Scientists are fond of bad puns).
A kilobyte (kbyte) ought to be 1000 bytes, but is actually 1024 bytes, because 210=1024.
Similarly a megabyte (Mbyte), gigabyte (gbyte) and terabyte (tByte) are equal to 220, 230 and 240 bytes, respectively.
What is the difference between the IEC byte representations and the metric byte representations?
The metric system is in base 10, whereas IEC is in base 2.
e.g. A kilobyte is 10002 bytes, whereas a kibibyte is 10242 bytes
“The kibibyte is closely related to the kilobyte. The latter term is often used in some contexts as a synonym for kibibyte, but formally refers to 103 bytes = 1000 bytes, as the prefix kilo is defined in the International System of Units.”
Note: When a laptop is sold with a 1TB hard drive, that means the hard drive is 10004 bytes in size, but when converted to gibibytes (the actual representation of binary data) it roughly equates to 931GiB
What is the difference between MB & MiB, GB & GiB etc…
The former is base 10 (kilobyte) whereas the latter is base 2 (kibibyte)
What is hexadecimal?
Hexadecimal (hex) is a base 16 number representation.
Four binary digits can represent 16 values and a hex digit can represent four binary digits. For convenience we often use hex rather than binary to write numbers as stored in a computer (remembering, of course, that all computers actually operate in binary).
In order to distinguish between decimal and hexadecimal, it is common to prefix a hexadecimal number with the string 0x.
How do you convert binary to hex?
- Break the binary number up into nibbles (4 bits)
- Convert those bits into hex characters (0-F)
e.g.
100111001100
1001 = 9, 1100 = C, 1100 = C
0x9CC
What are the main main components of a computer?
The Hardware:
- stores machine instructions (compiled programs) in main memory;and
- executes machine instructions.
The Operating system (the OS) is a collection of computer programs that:
- provides an interface between a user and the hardware;and
- provides an interface between the users and the system resources, such as the file system and print services.
The Application programs (or apps):
- provide specialised computing tools for the end user;
- include word processors, web browsers, database management systems, games,etc
What are the most popular ISA’s (Instruction Set Architectures)?
As of today, the two most widely used ISA (Instruction Set Architecture) are the Intel x86 and ARM architectures.
- All of Intel and AMD processors (across desktop,laptops to servers) uses x86 ISA
- ARM ISA is used by most of the mobile processors.
What is the difference between a CISC processor and a RISC processor?
Complex Instruction Set Computer (CISC) processors, like the x86, have a rich instruction set capable of doing complex things with a single instruction. Such processors often have significant amounts of internal logic that decode machine instructions to sequences of internal operations (microcode).
RISC architectures, in contrast, have a smaller number of more general purpose instructions, that might be executed with significantly fewer transistors, making the silicon cheaper and more power efficient. Like other RISC architectures, ARM cores have a large number of general-purpose registers and many instructions execute in a single cycle. It has simple addressing modes, where all load/store addresses can be determined from register contents and instruction fields.
So ARM is a simpler architecture, leading to small silicon area and lots of power save features, which made it attractive for all sorts of battery operated devices. while x86 becoming a power beast in terms of both power consumption and production.
“Processors that have a RISC architecture typically require fewer transistors than those with a complex instruction set computing (CISC) architecture (such as the x86 processors found in most personal computers), which improves cost, power consumption, and heat dissipation. These characteristics are desirable for light, portable, battery-powered devices—including smartphones, laptops and tablet computers, and other embedded systems.”
What are the two main components of the processor?
A processor (CPU) incorporates two main components:
- the control unit – that is responsible for performing the instruction cycle, i.e. determining what should be done next;
- the arithmetic logic unit (ALU) – that is responsible for performing arithmetic and boolean (logical) operations,i.e.actually performing the computations.
Every processor has an associated instruction set, which is the collection of instructions that the processor can process. This instruction set is specific to the type of processor.
What are registers?
Every processor has a number of special storage locations called registers.
Registers are reserved for very particular purposes. They:
- have very limited capacity (they have less than 100 bits each);
- can be accessed very quickly by the processor;
- are very limited in number (typically there are less than 40 of them).
Types of registers include:
- data registers;
- index registers; and
- control registers.
The exact nature of the set of registers will depend on the particular type of processor.
What are the uses of registers?
- the program counter (instruction pointer), which points to the memory location containing the instruction currently being executed;
- memory management (i.e. deciding which portions of the computer memory are used for which programs);
- stack management (where the stack is a special area of memory reserved for temporary storage);
- storage for intermediate results in calculations.
What is a computer program?
A computer program is a sequence of machine instructions that can be understood by a processor
A machine instruction specifies:
- the operation to be executed (the op code);
- the location(s) of the operand(s) in memory (where the operands are the values used as inputs to the operation). It is important to note that the numbers of memory locations are referred to as addresses.
For example,an instruction might specify:
Add (the contents of memory address) x to (the contents of memory address) y
What are some examples of instructions?
Typical examples of machine instructions include:
- Transfer data to a register from a specified location in computer memory (recalling that each memory location has a unique address);
- Transfer data from a register to a specified location in computer memory;
- Jump (transfer execution) to a specified location in computer memory, i.e. modify the program counter,which determines which instruction will be performed next;
- Perform an arithmetic or logical operation on one or more values at specified locations,and store the result somewhere,e.g.in a specific register;
- Transfer data to or from a specified input/output(I/O) device;
- Change the contents ofa control register.
What is a compiler?
Programs which can convert programs written in a high-level language into sequences ofmachine instructions are known as Compilers.
A compiler can include checks for poor programming practices (e.g. those which are likely to lead to security issues).
Compilers can have various settings, e.g. so that when developing a new program, the compiler includes lots of extra checks to help in debugging, i.e. the process of removing errors from a program while itis being written.
What does the control unit do?
The control unit is responsible for performing the instruction cycle:
- • it fetches an instruction from the memory location (address) specified by the program counter and stores it in the instruction register;
- • it decodes the instruction to determine what action the CPU should take;
- • it executes the instruction.