📜 ⬆️ ⬇️

Between the transistor and Arduinoy: planning seminars on electronics for schoolchildren in Kiev and Novosibirsk

More than 30 years ago, in 1986, I participated in the All-Union Novosibirsk Summer School for Young Programmers , where I received a first degree diploma for developing support for multitasking in the C language on the MSX Yamaha computer. Then I wrote in the Z80 assembler a timer interrupt handler in which I switched the task context. For time and age it was quite. And now, in 2017, I decided to go to LSYUP again, but already as an instructor, and already coordinated the program with the organizers. In the process, I will introduce students to some insider industrial projects in which I participate in Silicon Valley, in particular the project of the EyeQ5 chip for a self-driving car, which is scheduled for release in 2020.

And even before Novosibirsk, I decided to go to Kiev, where in the same 1986 I studied in the Physics and Mathematics School number 145 (from where I was actually sent to Novosibirsk). But the plan for 2017 in Kiev has not yet been approved, it is at the discussion stage, which I propose to conduct in the comments.



Briefly:
')
1. Weekly seminar for schoolchildren in Kiev, with a possible date at the end of April. The introduction of schoolchildren into electronics, using microcircuits of a small degree of integration on the breadboard, with the transition to FPGA, microcontrollers and embedded processors for IoT, all in the form of breadboardable modules. From junior schoolchildren (for them only combinational logic on chips with a small degree of integration) to senior schoolchildren (for them, sequential logic, hardware description languages ​​and synthesis). And for ordinary schools, and for physical schools. Work with a Ukrainian partner company to create kits for schoolchildren.

→ Plate with the draft program

2. Two-week “workshop” for schoolchildren at the famous Summer School for Young Programmers in Novosibirsk in the second half of July. The proposed material includes material that is being prepared for the seminar, but with variations, for example, instead of FPGA Xilinx, FPGA Altera will probably be, and instead of a set from a Ukrainian company, a similar set from a Russian company will be used. In addition, since there will be more specially selected children in Novosibirsk and twice as much time, we will try to introduce some advanced material, in particular, the concept of pipeline processing and the design of a simple processor on FPGA.

Announcement: school.iis.nsk.su/lshyup-2017/masterskie-6

First announcement in Novosibiosk:

http://school.iis.nsk.su/lshyup-2017/masterskie-6

Workshop number 1 "Workshop architects chips"
Master: Yuri Panchul

Digital hardware, from logic elements to its own processor

Want to learn how to design chips in modern devices - from the phone to the spacecraft? The last 25 years have been doing this using the logic code synthesis methodology in hardware description languages. This technology we will learn in our workshop and is applicable for the design of their own devices.

We will start with the three key building blocks of digital electronics - the logic element, the clock signal and the D-flip-flop, the memory for one bit of information. For clarity, we will master them in the old-fashioned way, connecting the chips with a small degree of integration on the breadboard.

Then we will repeat the constructed schemes in the language of hardware description SystemVerilog and model them on a simulator program. But how can we translate them into microchips? After all, ordering a commercial chip at a factory is very expensive? Fortunately, there are “tunable” programmable logic integrated circuits (FPGAs), the boards with which we will use for our classes.

In addition to exercises with arithmetic blocks and finite automata, we will try to build a simple processor similar in microarchitecture to a Mongoose-V processor inside the New Horizons spacecraft, which flew past Pluto a year ago.

At the same time, we will learn a little programming in assembler, the concept of interrupts, compare our processor with industrial microcontrollers and embedded microprocessors, right up to the EyeQ5 microprocessor for a self-driving car, which is scheduled for release in 2020.




The idea to organize an event in Kiev came to the head of Professor Svetlana Vladimirovna Khutkoy, who had taught at Stanford for three years (subject: democratic transformations in Ukraine) and looked at the teaching traditions of titans of the caliber John Hennessy, the former president of MIPS and co-author of two Computer Architecture: A Quantitative Approach and Computer Hardware / Software Interface. Professor Svetlana Vladimirovna in the center, a man in a tie - John Hennessy:



Now the question may arise: why does the workshop begin with microcircuits of a small degree of integration?

That is what Vladislav Khalamov from the Russian Association of Educational Robotics asked me the other day. He looked at this video that I shot in my garden:



and asked the question to which I painted the answer to Vladislav:



Now let's go step by step through the program of a possible Kiev event, which is a subset of the event in Novosibirsk. Starts with transistors:





The photo on the left is Alexander Barabanov, an associate professor at Kiev University of Kiev, who will tell you about the transistor and physics. On the right, Yevgeniy Korotky, head of the laboratory at the Lamp of the Kiev Polytechnic Institute KPI, he will tell about timer 555



Now we go to combinational logic and arithmetic:



Students will receive individual tasks with the following microchips:



And experiment with the logic of each, plugging the inputs into 0 or 9V and considering whether the LED connected to the output is lit:



This exercise can be complicated by connecting buttons. At the same time, you can tell about pull-up resistors (we will tell about resistors to limit the current through the LEDs earlier):



After that, participants will learn binary arithmetic and build an adder with CMOS 4008 chips:



Now we will return to the XXI century and do the same exercises with logic and arithmetic, but with FPGA / FPGA chips. For this there is such a module inserted into the breadboard:





Here are a couple of examples of Verilog code and schemes synthesized from it, which are stitched into the FPGA. From the control , which will be used during the seminars (at least in Novosibirsk, where there will be more time for the control):

module top1 ( input a, input b, input carry_in, output reg sum, output reg carry_out ); reg p, q; always @* begin p = a ^ b; q = a & b; sum = p ^ carry_in; carry_out = q | (p & carry_in); end endmodule 



If there are N teachers in Kiev who are ready to jointly make teaching materials for schoolchildren based on these FPGA modules, then I am ready to leave these modules to them after the seminar. But with the condition that they then write articles on Habré and (if we are talking about the educational package MIPSfpga) article on the site Imagination Technologies ( example 1 , example 2 , example 3 , example 4 , example 5 ):



With sequential logic, an important point is the explanation of what a D-trigger is for and why. It is clearer to do with chips of a small degree of integration:



Then you can make a shift register and counter - first with chips of a small degree of integration, and then on the FPGA:



 module shift_register ( input clock, input resetn, input in, input enable, output out, output reg [15:0] data ); always @ (posedge clock or negedge resetn) begin if (! resetn) data <= 16'b0; else if (enable) data <= { in, data [15:1] }; // data <= (data >> 1) | (in << 15); end assign out = data [0]; endmodule 



Finally, after the circuitry, you can talk, as these are the same actions (running lights, working with light sensors) not in the circuitry / reconfigurable hardware, but using the programming of microcontrollers / in software:



To do this, I use a Microchip PIC32MX microcontroller module inserted into a mock-up board, which I will discuss in a separate post:



For example, running lights implemented on it in a software way look like this:

 void main (void) { int n; TRISC = 0; // Setting LEDs on breadboard as outputs connected to port C n = 0x23; for (;;) { n = (n >> 1) | ((n & 1) << 7); PORTC = n << 2; delay (1000); } } 

The code is also similar, but the code on Veriloche and C code are of a different nature - the first describes the circuit, and the second the chain of commands, processor instructions in the von Neumann machine paradigm.

It is also planned to use the LinkIt Smart 7688 module with a MediaTek chip, which can run the built-in version of Linux called OpenWRT. External devices can be accessed from it in the standard open / read / write / close / ioctl Unix paradigm, as well as through the MRAA library, which came from Intel Edison and Galileo, and on Python:



Finally, the hackathon can be held:



On it, younger students can do projects with microcircuits of a small degree of integration, and older ones can connect various peripheral devices, such as sensors, to microcontrollers, FPGAs and embedded processors:



By the way, Vladislav Khalamov, from the educational-robotic association, agreed with the importance of the introduction of the FPGA:



So what do you say, gentlemen? Especially interested in the opinion of teachers from Kiev, as the plan for this event has not yet settled down.

Source: https://habr.com/ru/post/373303/


All Articles