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:
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.
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. |
Lab credit and the course test are completely independent.
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.
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.
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 |
![]() |
|
9.3.2021 | C/C++ language (cont.) |
![]() |
![]() |
16.3.2021 | Computer and CPU architecture |
![]() |
![]() |
23.3.2021 | CPU - instruction set, registers | ||
30.3.2021 | CPU - instruction set (cont.), stack | ||
6.4.2021 | Memory - addressing, data, alignment, allocation |
![]() |
|
13.4.2021 | Memory - memory hierarchy, cache | ||
20.4.2021 | Programming languages - compilation, libraries, linking, memory organization, function calls, parameter passing |
![]() |
|
27.4.2021 | Programming languages - variables, heap, runtime, source code portability, JIT | ||
4.5.2021 | Operating systems - role, architecture, CPU modes |
![]() |
|
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 |
![]() |
If you have any questions or suggestions related to the labs, please contact your corresponding teacher.
Library for your Arduino labs:
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 |
ReCodEx uses an Arduino emulator for validation of home assignments. Despite supporting all major features of the real Arduino, there are some differences:
Name | Example | Workaround |
---|---|---|
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"; |
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).
The first contact private information (ZOOM password, Mattermost invitation) is written in a notice on a SIS module "Notice board".
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.
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.
Date | Meeting ID | Meeting link | Recorded lecture/lab |
---|---|---|---|
1.3.2021 | 923 1505 8188 | Join the lab - Faltin | Recorded lecture |
2.3.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
3.3.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
8.3.2021 | 923 1505 8188 | Join the lab - Faltin | Recorded lecture |
9.3.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
9.3.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
10.3.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
16.3.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
17.3.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
23.3.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
23.3.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
24.3.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
30.3.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
31.3.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
6.4.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
6.4.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
7.4.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
13.4.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
14.4.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
20.4.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
20.4.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
21.4.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
27.4.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
28.4.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
4.5.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
4.5.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
5.5.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
11.5.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
18.5.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
18.5.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
19.5.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
25.5.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
26.5.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
1.6.2021 | 914 8545 2781 | Join the lab - Yaghob | DELETED |
1.6.2021 | 915 2445 5145 | Join the lecture - Yaghob | DELETED |
2.6.2021 | 934 5196 8778 | Join the lab - Šmelko | DELETED |
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.
Date | Time | Meeting ID |
---|---|---|