2019-02-03

vak: (Default)
В 57-й школе прошла открытая олимпиада по программированию. Несколько цитат из задач:

Задача С:
"Лиса Алиса и кот Базилио снова задумали новое дело. Для обсуждения деталей товарищи используют бельевую веревку, которая натянута между окнами. По этой веревке лиса и кот передают
сообщения в виде последовательностей целых чисел.
[...технические подробности...]
Однако как это уже случалось ранее, пробегавший под окнами лось Валера случайно перехватил
сообщение. Теперь Валера хочет узнать исходный текст сообщения. Помогите ему!"

Задача E:
"Вы уже догадались, каким образом лось Валера перехватил информацию? А вот лиса Алиса и
кот Базилио этого так и не поняли. Лучшим выходом из сложившейся ситуации лиса и кот посчитали
сменить шифр.
[...технические подробности...]
Как и в прошлый раз, пробегавший под окнами лось Валера перехватил такую строку с n − 1
знаками неравенства. Теперь лосю Валере интересно: какая же перестановка была зашифрована?
Помогите ему!"

Все задачи доступны по ссылке: http://57.mskobr.ru/files/attach_files/progstatement.pdf
vak: (Default)
Надыбал исходные коды микропрограммной реализации процессора ZPU: github.com/sergev/zpu-avalanche

Надо прикинуть, сложно ли будет переделать его на 24-битный размер команды и 48-битное слово.

"The ZPU is a very small, 32-bit processor, advertised by the developer Zylin as “the worlds smallest 32-bit CPU with GCC toolchain” [14]. The hardware description is licensed under a FreeBSD license and the software under the GNU General Public License (GPL). Both license models offer free redistribution and adaption of the sources, which is a prerequisite for modifications of the design.

The architecture of one ZPU Core is shown in Figure 2. It consists of only three main components: 1. The control and execution unit Execute does the instruction execution and address calculation; 2. The instruction decoder Decode x4 which fetches up to four instructions for decoding; 3. The stack registers Stack A and Stack B where two words from the main memory (Memory) stack are temporarily stored. The ZPU is a stack-based architecture; apart from Stack A and Stack B the ZPU has no further registers. Every calculation is done by first fetching the appropriate words sequentially from the stack to the registers and then executing the instruction. Afterwards the result is written back to main memory. Although the internal execution has several stages, no pipelining is present. This simplifies the control logic because no hazards can occur."

(из статьи "Designing and Manufacturing of Real Embedded Multi-Core CPUs: A Holistic Teaching Approach in Computer Architecture")