Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Summary of Content
Positional Notation
Positional notation or place-value notation is a method of representing or encoding numbers where the position of a digit affects its value. The base is usually the number of unique symbols, called digits, which a positional numeral system uses to represent numbers. For example, for the decimal system the base is 10, because it uses the 10 digits from 0 through 9. The base is an integer that is greater than 1, and the highest digit of a positional number system has the value one less than the value of the base. For example, in base 10, the value of the highest digit is 10 1 = 9. The number represented by a digit is the digit value multiplied by the place value. For example, the value of the digit 9 in the number string 94 is 9 10 = 90. The value represented by a string of digits is the sum of the numbers represented by each digit in the string. For example, the string 94 represents the number 90 + 4. Place values are the number of the base raised to the ith power, where i' is the position of the digit counting from right to left, starting with 0; i.e. the rightmost position is position 0, and has the place value 1 (b0 = 1). As an example of usage, the number 465 in its respective base 'b' (which must be at least base 7 because the highest digit in it is 6) is equal to: (4 b2) + (6 b1) + (5 b0) If the number 465 was in base 10, then it would equal: 4 102 + 6 101 + 5 100 = 4 100 + 6 10 + 5 1 = 465 If however, the number were in base 7, then it would equal: 4 72 + 6 71 + 5 70 = 4 49 + 6 7 + 5 1 = 243 Hence, 465 7 = 243 10 The least significant digit is the rightmost digit and has the place value b0, or 1 (any value raised to the power 0 is 1). Page 1 of 3
Basic Computer Architecture - Lesson 1 The most significant digit is the leftmost digit and has the value bn-1, where n is the number of digits in the sequence. For example, in base 10 and using 3 digits the most significant digit would have a place value of 103-1 = 102 =100. The range of values, lowest to highest, that could be represented in a given base b using n digits is from 0 to bn-1. For example, the range of values that could be represented in base 2 using 5 digits is 0 to 25 1, i.e. 0 to 31. The total number of unique values that could be represented in a given base b using n digits is bn. For example the highest value that could be represented in base 2 using 5 digits is 25 = 32 (the values 0 to 31 inclusive).
Base Conversion
Decimal to Base-b
To convert from a base-10 integer numeral to its base-b equivalent: 1. The number is divided by b, and the remainder is the least significant digit. 2. The (integer) result is again divided by b; its remainder is the next most significant digit. 3. Repeat Step 2 until the result of further division becomes zero. Example: Convert 123 10 to base-2; i.e. b = 2. 123 10 = 123/2 = 61/2 = 30/2 = 15/2 = 7/2 = 3/2 = 1/2 = 61 with a remainder of (1) 30 with a remainder of (1) 15 with a remainder of (0) 7 with a remainder of (1) 3 with a remainder of (1) 1 with a remainder of (1) 0 with a remainder of (1) = 1111011 2
Base-b to Decimal
To convert from base-b to base-10, proceed by applying the preceding algorithm in reverse. The digits of the number are used one by one, starting with the most significant (leftmost) digit. 1. Begin with the value 0. 2. Multiply the prior value by b and add the next digit, going from left to right, to produce the next value. 3. Repeat Step 2 until there are no more digits.
Page 2 of 3
Basic Computer Architecture - Lesson 1 Example: Convert 1111011 2 to decimal; i.e. b = 2. 0 1 3 7 15 30 61 2+ 2+ 2+ 2+ 2+ 2+ 2+ 1 1 1 1 0 1 1 1 3 7 15 30 61 123 = 123 10
Page 3 of 3
Summary of Content
Computer Architecture is the art of assembling logical elements into a computing device; the specification of the relationship between parts of a computer system.
Stored Program
A general-purpose computer that includes an instruction set, and can store in memory a set of instructions (a program) that details how to perform the computation.
Page 1 of 2
System Bus
Input
Output
CPU carries out program instructions sequentially. Memory stores programs and data. Input/Output transfers data to/from the outside world. System Bus moves data (and instructions) between the CPU and other devices. The advantage of this model is its simplicity. The disadvantage is that it uses a single bus to transfer data and instructions, which leads to a bottleneck (the Von Neumann bottleneck).
Page 2 of 2
Summary of Content
A bit (binary digit) is the smallest unit of storage in a computer. It can be either a 1 or a 0, and is represented by two different voltage levels in an electrical circuit. In order to represent and manipulate numeric values in a computer system it is necessary to use some coding scheme whereby each number can be represented or "encoded" by a unique sequence of bits. A "binary encoding system" is a one-to-one function for encoding a set of related data objects (for example, all integer values between 0 and 100 inclusive, or all the letters of the alphabet) into unique binary patterns.
Storage Units
Data in a computer is represented by a series of bits grouped together to form distinct patterns. A byte is a group of eight bits. A byte can be used to represent up to 256 different values (28 = 256). Page 1 of 2
Basic Computer Architecture - Lesson 3 A word is the number of bits that a computer accesses and manipulates together as a unit. The number of bits in a word depends on the design of the system and may be any multiple of bits.
Prefix
A SI prefix is a name that precedes a basic unit of measure to indicate a multiple of the unit. Each prefix has a unique symbol that is pre-pended to the unit symbol. The prefixes kibi, mibi, gibi and greater are often used in combination with the storage size units bit (b) and byte (B).
Text Symbol Factor Decimal Equivalent
Ki Mi Gi Ti
10
kilo (k) = 103 = 1000 mega (M) = 106 = 1000000 giga (G) = 109 = 1000000000 tera (T) 1012 = 1000000000000
1 Kib = 1 kibibit = 210 bits = 1024 bits 1 KiB = 1 kibibyte = 210 bytes = 1024 bytes = 1024 8 bits = 8092 bits 1 64-bit word contains 64 bits or 8 bytes
Memory
Memory consists of a sequence of re-writeable bits numbered from 0 to s-1, where s is the size of memory measured in bits. For example, 1 MiB = 220 8 bits = 8 388 608 bits. The bits are divided into units, each the size of a word; and each memory unit has an address number that is used to indicate its location. To determine the number of memory units, divide the size of memory in bits by the architectures word size. For example, given 1 MiB (220 8 bits) of memory and a 16-bit word; there are 524288 (220 8 16) memory locations number from 0 to 524287; i.e. memory address 0 contains the first 8 bits, etc. Each memory unit is addressed using a unique combination of bits. The number of bits used to indicate an address is dependent on the architecture. The architectures address space is the range of memory addresses that the CPU can specify given the amount of address bits specified by the architecture. Using n address bits the size of the address space is 2n and the range is 0 up to 2n 1. For example, given a 5 bit address the size of the address space is 25 = 32 memory units and the range of addresses is 0 to 31 (31 = 25 - 1).
Page 2 of 2
Summary of Content
Fetch-Decode-Execute Cycle
The system bus model runs programs in what is known as the von Neumann fetch-decodeexecute cycle, which describes how the machine works. The cycle starts immediately when power is applied to the system using an initial PC value that is predefined for the system architecture. One iteration of the cycle is as follows: 1. The control unit fetches the next program instruction from the memory and stores it in the instruction register (IR). The memory address of the instruction to be fetched is read from the the program counter (PC). After the instruction is fetched, the value in the program counter is incremented so that another instruction can be executed during the next cycle. 2. The instruction is decoded into a command the CPU can perform. Data (operand) required to execute the instruction copied into CPU registers. The address of the data to be read is stored in the memory address register (MAR). After the data is read from memory it is stored in the memory buffer (MBR). Page 1 of 2
Basic Computer Architecture - Lesson 4 3. The CPU executes the instruction and places the results in the accumulator (AC). After executing the instruction the cycle continues by fetching the next instruction pointed to by the instruction register.
Instruction Types
Some operations available in most instruction sets include: Data handling and Memory operations set a register to a fixed constant value. move data from a memory location to a register, or vice versa. read and write data from hardware devices. Arithmetic and Logic add, subtract, multiply, or divide the values of two registers, placing the result in a register. compare two values in registers. Control flow branch to another location in the program and execute instructions there. conditionally branch to another location if a certain condition holds.
Page 2 of 2
Decimal Value 1 2 3
100
SUB X
101
JUMP X
110
JUMPIF X
Description Copy the value at memory location X into the AC Copy the value in the AC to memory location X Adds the value at memory location x to the value in the AC Subtract the value at memory location x from the value in the AC Copy X into the PC (so that the instruction at memory location X would be executed next Perform JUMP X; If the value in the AC =0
REG. Notation X >> MAR [MAR] >> MBR >> AC X >> MAR AC >> MBR MBR >> [MAR] X >> MAR [MAR] >> MBR AC + MBR >> AC X >> MAR [MAR] >> MBR AC MBR >> AC X >> PC
IF AC = 0; X >> PC
Programmed I/O, also called polled I/O, is the simplest method. Each I/O
device has a CPU register which is used to signal the need for data transfer to or from the device. The CPU polls the I/O devices by running a program that checks the status of the CPU registers (flags) to determine if there are any I/O requests. If a request is detected the CPU performs the data transfer. The major problem with programmed I/O is the amount of time the CPU has to spend polling the I/O devices; time that could be spent performing other useful task.
DMA - Programs that perform data transfer are usually very simple, and can be
executed by a special purpose processor which can read from and write to memory (direct memory access). The DMA shares control of the system bus with the CPU. In a system which uses DMA the CPU offloads the tedious I/O operations to this special purpose processor. When data transfer is requested, the CPU passes the details to the DMA controller which intermittently takes control of the bus (cycle stealing) in order to complete the transfer before the I/O device times out. Programmed, Interrupt-driven and DMA are three types of I/O methods used in modern computer systems; each has its strengths and weaknesses. Programmed
I/O is usually preferred on embedded systems programmed to perform a specific task, e.g. alarms systems. However, most modern general purpose computers are interrupt driven as this allows for better user response. In a multitasking system where some programs perform mostly calculations and others that do mostly data transfers, DMA can prove to be an advantage.