





Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!






Bohm Jacopini Theorem: any flowchart can always be transformed into a structured flowchart equivalent to that given. (therefore, any logical flow can be made using only two control structures, decision mechanism, repetition mechanism [the loop]). There are two major classes of computers:
The Microprocessor is a chip that performs the functions of CPU (Central Processing Unit) in a computer or in a digital system. It is a complex element and represent the brain of the machine. A generic CPU contains: a control unit (also known by the acronym "CU") is a component of the CPUs which has the task of coordinating all the actions necessary for the execution of an instruction and sets of instructions. It is the component which gives the possibility to the microprocessor to execute different instructions. arithmetic and logical unit (also known by the acronym "ALU") which is responsible for carrying out the logical and arithmetic operations. Usually it is composed of combinatorial circuits. Each unit has a given task is not flexible, but still very fast. registers , special memory locations inside the CPU, very fast, which can be accessed much faster than from memory: the overall value of all the registers of the CPU constitutes the state in which it is currently located. The registers are few in number and small in size. Two registers always present are: the IR Register (Instruction Register), which stores the instruction being processed, and the PC (Program Counter), which contains the address in memory of the next instruction to be executed (and from which to fetch); the register of flags: this register does not contain conventional numerical values, but is rather a set of bits, called flags, which indicate particular CPU states and some information on the result of the last operation performed. The decoding unit takes care of receiving the input instructions and activating the appropriate internal processor units to execute the loaded instruction; The memory management unit ("MMU") is a class of hardware components that manages requests for memory access generated by the CPU. The MMU can perform various tasks including translating (or translating) virtual addresses into physical addresses, protecting memory, checking the CPU cache, bus arbitration, switching memory banks. Bus control unit. Buses (computer circulatory system) are hardware components that interface the different computer units or several computers. If poorly sized, it could be a 'bottleneck'. Features of a bus are: Transport of only one data at a time; Frequency, ie the numbers of data carried per second; Width, the number of bits that make up the single data. T = clock period - Measure unit = s f = clock frequency ( = 1 / T ) - Measure unit = s
= Hz (cycles/s) A single bus is divided into three 'sub-buses':
From Binary to Decimal: the definition written above applies, making the weighted sum of the binary digits. EXAMPLE: 1101 = 1 * 2 ^ 3 + 1 * 2 ^ 2 + 0 * 2 ^ 1 + 1 * 2 ^ 0 = 8 + 4 + 0 + 1 = 13; From Decimal to Binary: we proceed with successive divisions by 2, reporting the remainder (which can be 1 or 0); at the end of the operation, the remains are 'copied' in the reverse order. EXAMPLE: 13 6 3 1 0 1 0 1 1 = 1101 Across the binary language numbers limited by the number N of available bits can be represented: to be exact, 2^N combinations can be created (where the minimum is 0 and the maximum 2^N-1, included). [Min = 00 ... 0 Max = 11 ... 1]. Operations with binary numbers: SUM , basic rules. *0 + 0 = 0 * 1 + 0 = 1 * 1 + 1 = 0 with carryover of 1; DIFFERENCE , basic rules. * 0 - 0 = 0 *1 - 1 = 0 *1 - 0 = 1 *0 - 1 = 0 with a loan of 1 to the next figure. 1 1 - 0 1 1 0 + 0 1 0 1 - 0 1 1 1 = 0 0 1 1 = 1 1 0 1 0 0 1 0 There are limitations on the sum: Overflow. It indicates the error that occurs in an automatic calculation system when the result of an operation cannot be represented by the same coding and number of bits of the operands. In the sum in pure binary there is an overflow when working with a fixed number of bits and carrying on the MSB. To represent binary numbers, there are several encodings: Form and sign: the MSB will assume a value of 0 for a positive sign, 1 if the sign is negative; a Bit will be occupied by the sign and N-1 Bit by the module. The disadvantages are double zero (zero is representable as 00 = + 0 and 10 = -0), complex operations. With N Bit number, it is representable the interval [- (2𝑁 − 1 - 1), 2𝑁 − 1 - 1] (we speak of a symmetrical range); 2's complement: in this coding for the N-bit number, the MSB has negative weight, equal to −2𝑁 − 1. While the other bits have positive weight. Consequently, the MSB always indicates the sign: 0 = + 1 = -. As for the operations, these are carried out regardless of the signs of the operands. With operands having a discordant sign, overflow can never occur, while, otherwise, the overflow occurs when the result has a sign different from that of the operands; in the event that a carry occurs on the last digit, it is not considered. To convert a signed decimal number to CA2 : if the number is positive, CA2 = M&S; if the number is negative, the corresponding positive is calculated in M&S, after which it is copied from right to left up to the first number 1, then copied by inverting the ones with zeros.
The logic on which the computer is based is the Boolean logic, based on variables that are capable of assuming only two values, True or False, and central importance has the distinction between dependent and independent variables. Logic gates : are the basic building blocks of any digital system. It is an electronic circuit having one or more than one input and only one output. The relationship between the input and the output is based on a certain logic. Based on this, logic gates are named as AND gate, OR gate, NOT gate etc.
Char: 1 byte; Int: 2 bytes (depends on the structure of the computer); Long: 4 bytes (depends on the structure of the computer); Float: 4 bytes; Double: 8 bytes (depends on the structure of the computer); Long double: 12 bytes (depends on the structure of the computer). 1byte = 8bit Multiple bytes:
Nome Simbolo Nome Simbolo 1kilobyte kB = 10^3 byte kibibyte KiB = 2^10 byte 1megabyte MB = 10^6 byte mebibyte MiB = 2^20 byte 1gigabyte GB = 10^9 byte gibibyte GiB = 2^30 byte Memory It stores data and instructions that the computer needs to execute. Features: Addressing Parallelism Access (sequential or random) Addressing Memory is organized in cells (minimum directly accessible unit). An address (number) is assigned to each cell for uniquely identifying it.
Parallelism Each memory cell contains a fixed quantity of bits: Same for all the cells (of a certain memory unit) Accessible with a unique Bus Cycle It is a multiple of a byte At least 1 byte (typically a word for the main memory) Internal Memory Inside the computer Solid state (chip) Usually volatile Fast (nanoseconds, 10-^9 s) • Limited quantity (some GB) • Not removable Expensive (0.1 € / MB) External Memory External to the computer Sometime removable Not electronic (e.g., magnetic, optical) • Permanent Slow (milliseconds, 10-3s) Large quantity (some TB) Cheap (0.1 € / GB) Type of representation of an image: Raster: graphic information represented as a pixel matrix; Vettoriale: graphic information represented by matematic relations (functions). Formula for the calculation of bytes needed to store an image BxH and 16384 colors: (B x H) + (n° colors x 3) = tot bytes (n° colors x 3) = (3 x 2n) where n is the number of bits required to store an image: 256 = 2^8 = 8 bits = 1 byte 65526 = 2^16 = 16 bits = 2 bytes … In this case we need at least (3 x 16384) + (B x H) bytes