Numerical coding of data types;low level coding of symbolic instructions and numeric coding;architecture of Risc processor;compiling and assembling.Definition of the C programming language;syntax, grammar, syntactic tree, BNF, semantics; data types, variables and constants, operators and expressions, pointers, arrays, instructions, functions, structured data.
Lists:implementations and operations;iterations and recursions.
Searching and sorting algorithms. Execution costs and complexities.
Stefano Berretti. Laura Carnevali, Enrico Vicario, "Fondamenti di Programmazione, linguaggio c, strutture dati e algoritmi elementari, c++," Editrice Esculapio, Bologna.
The C code of several examples is available on the course web site.
Learning Objectives
Provide the base knowledge of the computer architecture and of the program execution. The C language is presented and used. At the end of thhe course the students will be able to write programs of medium complexity. In addition, algorithms for managing basic data structures will be presented, and the algorithms for search and sorting.
Prerequisites
Interest, capacity in logical reasoning, deductive knowledge, capacity in attention and application to real problems.
Teaching Methods
Class teaching with some programming assignment in laboratory.
The exam comprises a written and oral examination.
The written test includes some programming exercises which requires to produce C functions to solve specific problems. Other exercises can comprise the grammar and syntax of the C language. To access to the oral examination, in addition to score a positive evaluation, the candidate must produce a running program of one of the exercise of the written test. This program must be self-contained and it must be possible to compile and run it. The written test is performed on paper (non PC use). After the conclusion, the assigned tests and their solutions are made available on the Moodle platform.
The oral examination starts with the discussion of the program and of the written test, and continues with questions that covers all the course content.
Course program
PART I: LOW LEVEL REPRESENTATION
Introduction to the C programming language; numerical coding of data type; low level coding of instructions in synbolic form (assembler MIPS) and numeric form (machine language MIPS); computer architecture of a Risc processor (Risc4000); assembling and compiling .
PART II: C PROGRAMMING LANGUAGE
Definition of a programming language: sintax, grammar, sinthactic tree, BNF, semanticx; C programming language: types, variables, and constant. Operator and expressions. Pointers and Array. Instructions, functions, strctured data.
PART III: ELEMENTARY DATA STRUCTURE
List: sequential representation, representation with arrays and indexes, linked representation with pointers; iteratite and recursive algorithms.
PART IV: ELEMENTARY ALGORITHMS
Execution cost and complexity; Search algorithms: sequential, binary, jump search; Sorting algorithms: sequential sort, bubble-sort, merge-sort, quicksort, heapsort. Complexity of a problem: the case of sorting.