- Computer Architecture
- Summary
Course Syllabus
Obiettivi
Alla fine del corso lo studente avrà: conoscenza degli elementi dell’architettura di un semplice elaboratore e delle basi della programmazione assembly; abilità di progettare piccole modifiche alla struttura interna di un calcolatore e di scrivere semplici programmi assembly; competenza nel valutare le tecnologie più adeguate, in termini di prestazioni, per diversi ambiti di elaborazione.
L'architettura di riferimento per il corso è MIPS32.
Al termine del corso, gli studenti saranno in grado di:
- comprendere e saper descrivere i componenti principali dell'architettura hardware di un computer e le loro funzioni principali (Conoscenza e capacità di comprensione)
- comprendere (Conoscenza e comprensione) e saper sviluppare (Conoscenza e capacità di comprensione applicate) semplici programmi con il linguaggio di programmazione Assembly
- comprendere (Conoscenza e comprensione) e simulare (Conoscenza e capacità di comprensione applicate) il comportamento delle varie componenti della catena programmativa che porta un pogramma scritto in linguaggio di alto livello ad essere pronto per l'esecuzione
- comprendere il percorso dei dati nell'esecuzione delle singole istruzioni elementari e aggiungere nuove istruzioni all'Instruction Set Architecture (Conoscenza e capacità di comprensione applicate)
- comprendere la modalità di gestione delle eccezioni di elaborazione (Conoscenza e comprensione) e saper scrivere codice sorgente in Assempbly per realizzarla (Conoscenza e capacità di comprensione applicate)
- comprendere le diverse modalità di gestione dell'interazione con le periferiche di I/O (Conoscenza e comprensione) e saper scrivere codice sorgente in Assembly per realizzarle (Conoscenza e capacità di comprensione applicate)
- comprendere e saper simulare il comportamento delle diverse tipologie di classi di memoria (Conoscenza e capacità di comprensione applicate);
Contenuti sintetici
- Codifica dei diversi tipi di informazione (numeri interi e reali, caratteri e testo)
- Principali elementi dell’architettura hardware di un elaboratore (architettura di Von Neumann, reti combinatorie e sequenziali)
- Catena programmativa
- Instruction Set Architecture
- Controllo del percorso dei dati per l'esecuzione di istruzioni
- Gestione delle eccezioni
- Tecniche di gestione dell'ingresso/uscita
- Gerarchie di memoria: cache
(MIPS32 è l'architettura di riferimento per il corso)
Programma esteso
- Rappresentazione del'informazione
- rappresentazione dell'informazione non numerica
- rappresentazione dei numeri interi con e senza segno
- rappresentazione dei numeri in virgola fissa e mobile
- Circuiti logici
- reti combinatorie
- reti sequenziali e FSM (Finite State Machine)
- rassegna di circuiti notevoli (decoder, multiplexer, register file, ALU, etc.)
- Instruction Set Architecture
- schema di von Neumann
- CPU, registri, ALU e memoria
- ciclo fondamentale di esecuzione di una istruzione (fetch/decode/execute)
- tipi e formati di istruzioni MIPS32
- modalità di indirizzamento
- Linguaggio Assembly
- formato simbolico delle istruzioni
- catena di programmazione (compilatore, assembler, linker, loader, etc.)
- pseudo-istruzioni e direttive dell'assemblatore
- scrittura di semplici programmi assembly
- convenzioni programmative (memoria, nomi dei registri, etc.)
- Datapath
- percorsi dei dati per le diverse classi di istruzioni
- controllo del percorso dei dati con FSM (implementazione multi-ciclo)
- Gestione delle eccezioni
- tassonomia di eccezioni in terminologia MIPS32
- Registri Cause e EPC e modifiche alla FSM di controllo per la gestione delle eccezioni
- Exception handler
- Tecniche di gestione dell'ingresso/uscita
- controllo di programma
- interruzione di programma
- accesso diretto alla memoria
- Gerarchie di memoria: cache
- cache a mappatura diretta
- cache fully associative
- cache n-way set associative
Prerequisiti
Nessuno
Modalità didattica
- 14 lezioni da 2 ore svolte in modalità erogativa in presenza
- 2 lezioni da 2 ore svolte in modalità erogativa in remoto asincrono
- 10 esercitazioni da 2 ore svolte in presenza in modalità 50% erogativa 50% interattiva
- 8 attività di laboratorio da 3 ore svolte in modalità interattiva in presenza
Materiale didattico
- Libro di testo: David Patterson, John Hennessy: Computer Organization and Design, The Hardware/Software Interface, 5th edition, Morgan Kaufmann (Elsevier) / versione in lingua italiana "Struttura e progetto dei calcolatori" Zanichelli
- Materiale disponibile su elearning relativo a lezioni (lucidi presentati dal docente), esercitazioni (esercizi presentati dal docente con soluzioni) e laboratorio (quiz Moodle relativi a esercizi di laboratorio con soluzioni)
Periodo di erogazione dell'insegnamento
Primo semestre
Modalità di verifica del profitto e valutazione
Sono previste due prove in itinere, tenute una a metà e una a fine semestre e relative ai contenuti erogati fino al momento dello svolgimento della prova stessa. La prova in itinere può essere sostenuta una sola volta e la media delle valutazioni ottenute nelle due prove costituirà la votaizone finale.
In alternativa, sono previsti appelli lungo tutto l'anno accademico relativi ai contenuti dell'intero corso.
Ogni prova (sia parziale in itinere che esame completo) prevede una sessione al calcolatore, comprendente una parte "filtro" con domande a risposta chiusa (2/3 domande per ciascun macro-argomento trattato al corso) ed una parte con domande a risposta aperta (una per ogni macro-argomento). Il voto si ottiene solo svolgendo anche la parte a risposta aperta. Per l'accesso alle domande aperte è necessario rispondere correttamente ad almeno una domanda chiusa per ciascuno dei macro-argomenti. Ad ogni domanda chiusa lo studente ha la possibilità di scegliere di non rispondere (in tal caso gli sarà assegnato un punteggio nullo) mentre se risponderà erroneamente sarà aggiunta una penalizzazione al voto finale. Le domande aperte sono valutate tenendo in considerazione sia la completezza dei contenuti sia la qualità della forma espositiva .
Orario di ricevimento
Tramite appuntamento da concordare via email
Aims
By the end of the course, students will have: knowledge of the architecture of a simple computer and the basics of assembly programming; the ability to design small modifications to a computer's internal structure and write simple assembly programs; and the ability to evaluate the most suitable technologies, in terms of performance, for different processing areas.
The reference architecture for the course is MIPS32.
Upon completion of the course, students will be able to:
- understand and describe the main components of a computer's hardware architecture and their main functions (Knowledge and Understanding)
- understand (Knowledge and Understanding) and be able to develop (Applying Knowledge and Understanding) simple programs using the Assembly programming language
- understand (Knowledge and Understanding) and simulate (Applying Knowledge and Understanding) the behavior of the various components of the programming chain that brings a program written in a high-level language to its execution
- understand the datapath in the execution of individual elementary instructions and add new instructions to the Instruction Set Architecture (Applying Knowledge and Understanding)
- understand how to handle processing exceptions (Knowledge and Understanding) and be able to write source code in Assembly to implement it (Applying Knowledge and Understanding)
- understand the different ways of managing interaction with I/O devices (Knowledge and Understanding) and be able to write Assembly source code to implement them (Applying knowledge and understanding)
- understand and be able to simulate the behavior of different types of memory classes (Applying knowledge and understanding);
Contents
- Information representation (integer numbers, floating point numbers and text)
- Main components of the hardware architecture of a computer
- Instruction set architecture
- Programming toolchain
- Datapath control
- Exception handling
- I/O techniques
- Memory hierarchies: cache
(MIPS32 is the reference architecture for the course)
Detailed program
- Information representation in digital computers
- representation of non numeric information
- representation of positive and negative integer numbers
- fixed and floating point representation of numbers
- Logic circuits
- combinatorial circuits
- sequential circuits and FSMs (Finite State Machines)
- overview of relevant circuits: decoder, multiplexer, register file, ALU, etc.
- Instruction Set Architecture
- von Neumann architecture
- CPU, registers, ALU and memory
- fundamental cycle of instruction execution (fetch/decode/execute)
- types and formats of MIPS instructions
- addressing modes
- Assembly language
- Symbolic format of instructions
- Software development toolchain (compiler, assembler, linker, loader, debugger, etc.)
- Pseudo-instructions and assembler directives
- Development of simple assembly programs
- Programming conventions (memory, register names, etc.)
- Datapath
- Datapath for each type of instruction
- Datapath control with FSM (multi-cycle implementation)
- Exception handling
- Taxonomy of exceptions in MIPS32
- Cause and EPC registers and modifications to the Control Unit FSM to manage exceptions
- Exception handler
- Techniques for I/O handling
- Polling (transfers under program control)
- Interrupt
- Direct Memory Access
- Memory classess : cache
- Direct mapping cache
- Fully associative cache
- N-way set associative cache
Prerequisites
No prerequisites
Teaching form
- 14 frontal lessons of 2 hours each held by the teacher in presence
- 2 frontal lessons of 2 hours each held by the teacher remotely in asynchronous mode
- 10 sessions for exercises of 2 hours each, held by the teacher in presence (50% frontal 50% interactive)
- 8 interactive laboratory lessons of 3 hours each held by the teacher in presence
Textbook and teaching resource
- Textbook: David Patterson, John Hennessy: Computer Organization and Design, The Hardware/Software Interface. Fifth edition. Morgan Kaufmann (Elsevier)
- Teaching material available on the elearning platform concerning lectures (slides), practices (exercices with solutions), and laboratory (Moodle quiz with solutions)
Semester
First semester
Assessment method
There are two ongoing tests, one mid-semester and one at the end of the semester, covering the content taught up to the time of the ongoing test. The ongoing test can be taken only once, and the average of the scores obtained in the two tests will constitute the final grade.
Alternatively, exams are scheduled throughout the academic year covering the entire course content.
Each test (both the ongoing partial test and the comprehensive exam) is a computer session, including a "filter" section with closed-ended questions (2-3 questions for each major topic covered in the course) and a section with open-ended questions (one for each major topic). A grade is obtained only by completing the open-ended section. To access the open-ended questions, students must correctly answer at least one closed-ended question for each major topic. For each closed-ended question, students have the option of not answering (in which case they will be assigned a zero score), while an incorrect answer will result in a penalty being added to their final grade. Open questions are evaluated taking into account both the completeness of the content and the quality of the presentation.
Office hours
By appointment to be agreed via email