covid19 Course info for the distance learning

About

This is an informational web page for the Computer Systems course (NSWI170), which is being taught at the Faculty of Mathematics and Physics, Charles University. The schedule for the course can be accessed in SIS.

You can find here:

Contact

The course is currently led by Jakub Yaghob and Lubomír Bulej. Please direct inqueries of a specific topic (or home assignment) to the teacher who presented the topic.

Latest Updates

16.2.2021 Preparation of the course for the academic year 2020/2021.
13.3.2020 COVID-19 info.
10.2.2020 A new web page was created.

Grading

Lab credit and the course test are completely independent.

Lab Credit

Each lab will hold one assignment (possibly broken down into several steps). The assignments are incremental, which means that your code and knowledge obtained when solving one assignment may be required for the subsequent assignment(s). The individual assignments lead to the final home assignment. To receive a credit for the labs, you need to complete all the individual assignments from all labs and sucessfuly present the final home assignment to your lab teacher.

Under regular circumstances, the individual lab assignments are solved during the labs. If one fails to complete the assignment during the labs or misses the class altogether, the assignment should be finished at home. In any case, the assignments has to be uploaded to ReCodEx before midnight of the day when the next lab starts.

The final home assignment has to be presented in person to your labs teacher. Individual labs will have individual terms for presentations (announced by the lab teacher before the summer examination period). Primary criterium for the credit is that your solution is fully functional. Secondary criterum is the code quality. Solutions which severely violate good coding practices will not be accepted.

Course Exam

The exam will be either a short online test or a short online interview. You must have a working camera and microphone for the online exam. Exam dates will be announced before the summer exam period in SIS. Exams will be added as needed.

Lectures

If you have any questions or suggestions related to the lectures, please contact the teachers.

The presented schedule is only informational. Teaching time for a matter may vary slightly depending on the student's grasp.

2.3.2021 Introduction, C/C++ language PPTX File Icon CS-00-INTRO.pptx
9.3.2021 C/C++ language (cont.) PPTX File Icon CS-01-C.pptx PDF File Icon LB-01-C.pdf
16.3.2021 Computer and CPU architecture PPTX File Icon CS-02-CPU.pptx PDF File Icon LB-02-CPU.pdf
23.3.2021 CPU - instruction set, registers
30.3.2021 CPU - instruction set (cont.), stack
6.4.2021 Memory - addressing, data, alignment, allocation PPTX File Icon CS-03-MEM.pptx
13.4.2021 Memory - memory hierarchy, cache
20.4.2021 Programming languages - compilation, libraries, linking, memory organization, function calls, parameter passing PPTX File Icon CS-04-LANG.pptx
27.4.2021 Programming languages - variables, heap, runtime, source code portability, JIT
4.5.2021 Operating systems - role, architecture, CPU modes PPTX File Icon CS-05-OS.pptx
11.5.2021 Operating systems - interrupt, exception, DMA
18.5.2021 Operating systems - process, thread, scheduling, file system
25.5.2021 Operating systems - virtual memory
1.6.2021 Parallel programming, synchronization PPTX File Icon CS-06-SYNC.pptx

Labs

If you have any questions or suggestions related to the labs, please contact your corresponding teacher.

Library for your Arduino labs: ZIP File Icon Funshield.zip

Faltin
Mo 12:20
Yaghob
Tu 10:40
Klusáček
Tu 12:20
Kruliš
We 12:20
Šmelko
We 12:20
Zavoral
We 12:20
Bednárek
We 14:00

Arduino emulator in ReCodEx

ReCodEx uses an Arduino emulator for validation of home assignments. Despite supporting all major features of the real Arduino, there are some differences:

Differences

NameExampleWorkaround
Unsupported complex initialization of global variables size_t t = millis(); Initialize the variable with a default value and call the complex initialization in the setup() function.
Unsupported communication API Serial.print(); Use the functions for local debugging only.
max is a macro at Arduino but a function in Recodex int x; long y; max(x,y); Always use min/max with identical types of arguments.
int/long are 16/32 bits at Arduino but 32/64 in Recodex int32_t x; long y; max(x,y); Do not mix int/long with int16_t/int32_t.
Funshield include #include <funshield.h> Replace by #include "funshield.h"
Conservative C++ (order of declarations) int main() { foo(); ...}
void foo() {...}
In C++, you need to declare functions (classes, ...) before you use them.
Static methods class Foo { static void foo() ... } Static methods do not work in ReCodEx, use plain old C functions instead.
Initialization class Button {
Button() { pinMode( b[0], INPUT); }
};
Emulator (Arduino) initilization (e.g., pinMode) MUST be called in setup. Early emulator initialization (e.g., in a constructor of a global object) causes a signal and your program is terminated.
Unsupported type String String stringOne = "Hello String"; Use standard C-strings instead, i.e., const char *stringOne = "Hello String";

Home Assignment

The objective is to create a random number generator which will simulate dice throws in Advanced Dungeons & Dragons game. The game uses various types of polyhedral dices with different numbers of sides (d4, d6, d8, ...). Furthermore, a generated random number represents a sum of multiple throws. E.g., 3d6 means that player should throw 3 times using a dice with 6 sides (cube) and take the sum of these three throws (which is a number between 3 and 18).

The dice is controlled by 3 buttons and display the results on the 4-digit LED display. It operates in two modes. In normal mode it displays last generated number on the LED display. In configuration mode it displays the type (and repetition) of dice being simulated. First digit (1-9) displays number of throws, second digit displays symbol 'd', and the remaining two digits display the type of dice (d4, d6, d8, d10, d12, d20, and d100 should be supported; d100 is denoted as '00' on the LED display).

It might be a good idea to show some 'activity' on the display whilst the random number is being generated (whilst the button 1) is pressed. You may show currently computed random numbers (if they change fast enought so the user cannot possibly stop at the right number), or you may create some sort of animation on LED display or using the other onboard LEDs.

Remember that the probability distribution is not uniform, but if follows Binomial distribution. Your simulator must use counter/time measurement of how long the button 1 has been pressed to get a random number (which follows uniform distribution). You may use additional pseudo-random generators (even Arduino built-in functions) to assist you with this task, but the initial randomness has to be tied somehow to the button event duration. Any reasonable implementation of binomial distribution will be accepted, but strictly uniform random generators will not (i.e., you need to implement binomial distribution using uniform random generator).

Distance learning

General information

First contact

The first contact private information (ZOOM password, Mattermost invitation) is written in a notice on a SIS module "Notice board".

Communication platform

We will use Mattermost communication platform for day-to-day communication among teachers and students. An invitation to the corresponding Mattermost team will be sent before the term starts by email. Join appropriate channels in the team (nswi170-compsys for general topics about the course and nswi170-compsys-xxxxxx, where xxxxxx is your lab teacher).

All available recordings from ZOOM lectures and labs are available on the course channel. Use your SIS login in the form xxx@cuni.cz for signing in.

Lectures

School of computer science uses the ZOOM communication platform. Each lecture/lab will be scheduled and provided as a separate ZOOM meeting. Below is a table with corresponding ZOOM meeting IDs. Zoom meeting passwords are hidden in a notice on a notice board (SIS module).

Lectures will be recorded for anyone not able to attend an online lecture. The recorded video will be placed on a streaming platform and a link will be published here.

Rules

DateMeeting IDMeeting linkRecorded lecture/lab
1.3.2021 923 1505 8188 Join the lab - Faltin Recorded lecture
2.3.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
3.3.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
8.3.2021 923 1505 8188 Join the lab - Faltin Recorded lecture
9.3.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
9.3.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
10.3.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
16.3.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
17.3.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
23.3.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
23.3.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
24.3.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
30.3.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
31.3.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
6.4.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
6.4.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
7.4.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
13.4.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
14.4.2021 934 5196 8778 Join the lab - Šmelko Recorded lab
20.4.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
20.4.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
21.4.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture
27.4.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
28.4.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture
4.5.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
4.5.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
5.5.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture
11.5.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
18.5.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
18.5.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
19.5.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture
25.5.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
26.5.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture
1.6.2021 914 8545 2781 Join the lab - Yaghob Recorded lab
1.6.2021 915 2445 5145 Join the lecture - Yaghob Recorded lecture
2.6.2021 934 5196 8778 Join the lab - Šmelko Recorded lecture

Labs

Labs will continue with the same timetable as planned originally, including deadlines for uploading your solution to ReCodEx.

Lab teachers were instructed to prepare more informational materials for you. Moreover, they will contact you with specific instructions. In case of any doubt, do not hesitate to contact your lab teacher.

Exams

DateTimeMeeting ID