generated from open-education-hub/oer-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
634 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "Vivado Slim Dev", | ||
//"build": { "dockerfile": "Dockerfile" }, | ||
"image": "gitlab.cs.pub.ro:5050/ac/ac-public/vivado-slim:1.0.0", | ||
"runArgs": [ | ||
"--rm", | ||
"--privileged" | ||
], | ||
//"appPort": [3121, 60001, 3042], | ||
"mounts": ["type=bind,source=/dev,target=/dev"], | ||
//"otherPortsAttributes": {"requireLocalPort": "true", "elevateIfNeeded" : "true"}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"mshr-h.veriloghdl" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
chapters/lab0/combinational/demos/hello-world-py/hello-world.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env python | ||
|
||
def main(): | ||
print(f'Hello world') | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Practice: Baby Steps | ||
|
||
We recommend that for practice, you add a subsection for the exercises. | ||
This will make it so you can delimit the exercises from the lab's text. | ||
|
||
1. You can number the exercises as such. | ||
And have the text roll over to the next line. | ||
|
||
1. This is a second numbered exercise. | ||
|
||
**Be careful!** | ||
You can even link to other chapters internally [like this](questions.md) | ||
|
||
Another neat feature is that you can add inline code that uses language specific highlight. | ||
|
||
```Python | ||
with event: | ||
while len(messages) == 0: | ||
event.wait() | ||
``` | ||
|
||
For now, a quiz can only be linked to as such: [Quiz 1](questions.md) |
1 change: 1 addition & 0 deletions
1
chapters/lab0/combinational/drills/hello-world/solution/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/hello-world |
19 changes: 19 additions & 0 deletions
19
chapters/lab0/combinational/drills/hello-world/solution/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CFLAGS = -Wall -Wextra | ||
CPPFLAGS = -I utils/ -I utils/log/ | ||
|
||
EXEC = hello-world | ||
OBJ = $(patsubst %,%.o,$(EXEC)) | ||
SRC = $(patsubst %,%.c,$(EXEC)) | ||
|
||
all: $(EXEC) | ||
|
||
$(EXEC): $(OBJ) utils/log/log.o | ||
|
||
$(OBJ): $(SRC) | ||
|
||
utils/log/log.o: utils/log/log.c | ||
|
||
clean:: | ||
-rm -f $(OBJ) utils/log/log.o | ||
-rm -f $(EXEC) | ||
-rm -f *~ |
16 changes: 16 additions & 0 deletions
16
chapters/lab0/combinational/drills/hello-world/solution/hello-world.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
#include <sys/wait.h> | ||
|
||
#include "utils.h" | ||
|
||
int main(void) | ||
{ | ||
/** | ||
* TODO 1: Print a hello world message | ||
*/ | ||
printf("Hello world\n"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../common/utils/ |
1 change: 1 addition & 0 deletions
1
chapters/lab0/combinational/drills/hello-world/support/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/hello-world |
19 changes: 19 additions & 0 deletions
19
chapters/lab0/combinational/drills/hello-world/support/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CFLAGS = -Wall -Wextra | ||
CPPFLAGS = -I utils/ -I utils/log/ | ||
|
||
EXEC = hello-world | ||
OBJ = $(patsubst %,%.o,$(EXEC)) | ||
SRC = $(patsubst %,%.c,$(EXEC)) | ||
|
||
all: $(EXEC) | ||
|
||
$(EXEC): $(OBJ) utils/log/log.o | ||
|
||
$(OBJ): $(SRC) | ||
|
||
utils/log/log.o: utils/log/log.c | ||
|
||
clean:: | ||
-rm -f $(OBJ) utils/log/log.o | ||
-rm -f $(EXEC) | ||
-rm -f *~ |
15 changes: 15 additions & 0 deletions
15
chapters/lab0/combinational/drills/hello-world/support/hello-world.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
#include <sys/wait.h> | ||
|
||
#include "utils.h" | ||
|
||
int main(void) | ||
{ | ||
/** | ||
* TODO 1: Print a hello world message | ||
*/ | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../common/utils/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# TODO question | ||
|
||
## Question Text | ||
|
||
Which answer is the correct answer? | ||
|
||
## Question Answers | ||
|
||
- Bad answer 1 | ||
+ Correct answer | ||
- Bad answer 2 | ||
- Bad answer 3 | ||
|
||
## Feedback | ||
|
||
Correct answer is the correct answer | ||
|
||
```console | ||
echo "Guess why" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Guides | ||
|
||
## Executable Paths | ||
|
||
Single instances of commands should be written using monotype fonts such as this `ls`. | ||
|
||
For longer outputs, you will use the following syntax: | ||
|
||
```console | ||
student@os:~$ which ls | ||
/usr/bin/ls | ||
|
||
student@os:~$ file /usr/bin/ls | ||
/usr/bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6e3da6f0bc36b6398b8651bbc2e08831a21a90da, for GNU/Linux 3.2.0, stripped | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Circuite combinaționale | ||
|
||
Circuitele logice combinaționale aplică funcții logice pe semnalele de intrare pentru a obține semnalele de ieșire. Valorile de ieșire depind doar de valorile de intrare, iar când starea unei intrări se schimbă, acest lucru se reflectă imediat la ieșirile circuitului. | ||
|
||
![Diagrama bloc pentru un circuit combinațional cu n intrări și m ieșiri](../media/circuit-comb.png) | ||
|
||
|
||
|
||
Logica combinațională poate fi reprezentată prin: | ||
- diagrame structurale la nivel de porți logice | ||
- tabele de adevăr | ||
- expresii booleene (funcții logice) | ||
|
||
Circuitele combinaționale sunt folosite în procesoare în cadrul componentelor de calcul, iar cele mai des întâlnite sunt: | ||
- multiplexoarele și demultiplexoarele | ||
- codificatoarele și decodificatoarele | ||
- sumatoarele | ||
- comparatoarele | ||
- memoriile ROM (read-only, nu păstrează stare) | ||
|
||
Un exemplu de folosire a sumatoarelor este în cadrul Unităților Aritmetice-Logice (UAL) din interiorul procesoarelor. | ||
|
||
## Porți logice | ||
|
||
Porțile logice reprezintă componentele de bază disponibile în realizarea circuitelor combinaționale. Ele oglindesc operațiile din algebra booleană, algebră care stă la baza teoriei circuitelor combinaționale. În sunt prezentate cele mai întâlnite porți logice împreună cu operația booleană pe care o implementează. | ||
|
||
<table> | ||
<tr> | ||
<td>Denumire</td> | ||
<td>Simbol</td> | ||
<td>Operator</td> | ||
<td colspan='3'> Tabel de adevăr </td> | ||
</tr> | ||
<tr> | ||
|
||
</tr> | ||
</table> | ||
|
||
|
||
| Denumire | Simbol | Operator | <td colspan='3'> Tabel de adevăr </td> | | ||
|:-:|:-:|:-:|:-:|:-:|:-:| | ||
|Inversor (NOT)|![](../media/gate-not.png)|f = !a | <td colspan='2'>a | f | | ||
||| <td colspan='2'> 0 | 1 | | ||
||| <td colspan='2'> 1 | 0 | | ||
|
||
| Poarta SAU \\ (OR) | ![](../media/gate-not.png) | f = a %%||%% b | a | b | f | | ||
| | | | 0 | 0 | 0 | | ||
| | | | 0 | 1 | 1 | | ||
| | | | 1 | 0 | 1 | | ||
| | | | 1 | 1 | 1 | | ||
| Poarta ŞI \\ (AND) | ![](../media/gate-not.png) | f = a && b | a | b | f | | ||
| | | | 0 | 0 | 0 | | ||
| | | | 0 | 1 | 0 | | ||
| | | | 1 | 0 | 0 | | ||
| | | | 1 | 1 | 1 | | ||
| Poarta \\ SAU-NU \\ (NOR) | ![](../media/gate-not.png) | f = !(a %%||%% b) | a | b | f | | ||
| | | | 0 | 0 | 1 | | ||
| | | | 0 | 1 | 0 | | ||
| | | | 1 | 0 | 0 | | ||
| | | | 1 | 1 | 0 | | ||
| Poarta \\ ŞI-NU \\ (NAND) | ![](../media/gate-not.png) | f = !(a && b) | a | b | f | | ||
| | | | 0 | 0 | 1 | | ||
| | | | 0 | 1 | 1 | | ||
| | | | 1 | 0 | 1 | | ||
| | | | 1 | 1 | 0 | | ||
| Poarta \\ SAU EXCLUSIV \\ (XOR) | ![](../media/gate-not.png) | f = a %%^%% b | a | b | f | | ||
| | | | 0 | 0 | 0 | | ||
| | | | 0 | 1 | 1 | | ||
| | | | 1 | 0 | 1 | | ||
| | | | 1 | 1 | 0 | | ||
| Poarta \\ SAU EXCLUSIV NU \\ (XNOR) | ![](../media/gate-not.png) | f = !(a %%^%% b) | a | b | f | | ||
| | | | 0 | 0 | 1 | | ||
| | | | 0 | 1 | 0 | | ||
| | | | 1 | 0 | 0 | | ||
| | | | 1 | 1 | 1 | | ||
Porțile logice de bază | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/slides.md | ||
/_site/ | ||
/media/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
RVMD = reveal-md | ||
MDPP = markdown-pp | ||
FFMPEG = ffmpeg | ||
|
||
SLIDES ?= slides.mdpp | ||
SLIDES_OUT ?= slides.md | ||
MEDIA_DIR ?= ../media | ||
SITE ?= _site | ||
OPEN ?= xdg-open | ||
|
||
.PHONY: all html clean videos | ||
|
||
all: videos html | ||
|
||
html: $(SITE) | ||
|
||
$(SITE): $(SLIDES) | ||
$(MDPP) $< -o $(SLIDES_OUT) | ||
$(RVMD) $(SLIDES_OUT) --static $@ | ||
|
||
videos: | ||
test -z $(TARGETS) || for TARGET in $(TARGETS); do \ | ||
$(FFMPEG) -framerate 0.5 -f image2 -y \ | ||
-i "$(MEDIA_DIR)/$$TARGET/$$TARGET-%d.svg" -vf format=yuv420p $(MEDIA_DIR)/$$TARGET-generated.gif; \ | ||
done | ||
|
||
open: $(SITE) | ||
$(OPEN) $</index.html | ||
|
||
clean: | ||
-rm -f $(MEDIA_DIR)/*-generated.gif | ||
-rm -fr media/ | ||
-rm -fr $(SITE) | ||
-rm -f $(SLIDES_OUT) | ||
-rm -f *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Slides hierarchy | ||
|
||
--- | ||
|
||
## Slides Hierarchy | ||
|
||
* Slides are organized in two levels | ||
* We use `---` in order to open up a new topic. | ||
This leads to a new horizontal slide figuring a topic that can be expanded by vertical slides. | ||
* We expand discussions on the same topic by vertical slides. | ||
We use `----`, which adds a new vertical slide | ||
|
||
---- | ||
|
||
### New Vertical Slide | ||
|
||
* This slide illustrates a new item of discussion on the matter of the slides hierarchy | ||
|
||
--- | ||
|
||
### Animated Slides | ||
|
||
* You can even animate slides like this | ||
|
||
``` [1 - 2 | 3 - 4] | ||
student@os:~/.../compute/lecture/demo/create-process$ strace -e clone ./fork_exec | ||
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f7e83aa4810) = 5302 | ||
student@os:~/.../compute/lecture/demo/create-thread$ strace -e clone ./create_thread | ||
clone(child_stack=0x7f9ea7df0fb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, tls=0x7f9ea7df1700, child_tidptr=0x7f9ea7df19d0) = 5389 | ||
``` | ||
|
||
--- | ||
|
||
### Tables | ||
|
||
You can include tables: | ||
|
||
| Advantages | Disadvantages | | ||
| :------------------------------: | :----------------------------------------: | | ||
| implemented by libraries | implemented by the kernel | | ||
| blocking actions stall process | blocking actions only stall current thread | | ||
| more mapped on one kernel thread | provide support for user level threads | | ||
| Java, Python | Linux KThreads, Windows threads | |
Oops, something went wrong.