I'm going to talk about big adventure of little professor and it's four bit handheld friends running TMS 1000. Thank you K-Stuff. Okay. Hello everybody. I need to recover a little bit. So let me introduce my talk. I don't know if you know what little professor is from Texas Instruments. I can see some heads moving. So who has already seen this kind of device? That's okay. Who has already seen that device? Okay. Who had one when he was a kid? Okay. Who has already played with one? Okay. Thank you. So this is the starting point actually of my talk because, well, I'm from a computer museum. I'm also a computer scientist and retro guy. And in the museum, actually, we do a lot of things but we collect artifacts and we also try to explain them and to preserve them. And one year ago, we got one of those and it reminded me of my childhood and what was in this device. Okay. So if you want to play, I can circulate. I want them back at the end of my talk, of course. So you can try it. And you see, I have a bigger version here. We'll talk about it at the end of my talk. So the idea was to, well, first to look at that device. So you can see here, little video. So it's very simple. You can choose a level, one, two, three, four, from simple to difficult. Then you choose an operation. And then you start the device. So the device is not a calculator. It's a reverse calculator. It will generate problems and train you to do mathematics to learn different operations, typically for charts between five and 12. And so you can see here, it was one of the first version, a very simple subtraction. Oh, sorry. And if you are wrong, of course, it will display error, EEE. And you have three, you can have three tentatives. And then it gives you the answer. And you have 10 of those questions and then you have a global score. So this was very successful. And it appeared in the 70s, about 76, for the first version. And it was very, very successful. And there were a lot of variants after. So you can see on the side there were other devices. Actually, the little professor, the most iconic, one and most, we were both one. And also the one that is still actually available. There is still a solar version that is sold online. And so, well, it's what's really interesting. So our first project was to build this, actually. We wanted the kids to experience that and to play with it in the museum. So the first thing we decided to do is to build a big version, a large version of it. So it's still a prototype, so we do print it. And before, well, of course, that prototype is built with current technology. So we use Arduino, a LED display. And we build our own keyboard. Keyboard, so the keyboard, actually, you have to think about how to scan the key. So it's interesting. And actually, after the second step, we decided to look inside the little professor and see, oh, it was built. Actually, inside, you will find also one microcontroller that was very interesting, because for reducing the cost, that was the design. That does everything, including the ROM, the clock, and of course, the processor. And the keyboard, actually, is the same principle. It's also based on the skyline, and it's directly managed by the microcontroller. So you can see that there are a lot of them, many variants, and also many different ones. So this guy there from Datamatt, a German guy who moved to the United States, so he has them all and has analyzed everything. So it was really a very deep source for this presentation. And so, well, what did I discover inside that little professor? Actually, you can see there, there is only one microcontroller, and that's about it. You have the display, and you have the keyboard. If you look at another one, this is the Merlin. Actually, you see the display is a bit different, it's based on the touch, but you also have the same kind of processor, but it's a variant. It's not the same, because actually, as you will see, it's a microcontroller, and it has the RAM, you can see on that side, on the left side here, and the RAM here on the right side, you see the program counter, the instruction PLA, where actually it's microcode, so you have the microcode there, the accumulator, and the resource clock, and the driver here for the display. So you have everything inside, and of course, the ROM is really burned inside. If you change the device, of course, you have to build another one. Another interesting point is that as the ROM is inside, you need to be able to access that ROM in order to get it for building an emulator. So I will come that later. But an interesting point for that, well, interesting point about architecture that will make this a bit more complex, is that it's not a von Neumann architecture, it's a Harvard architecture. So the Harvard architecture actually has a separate bus between for the ROM and the RAM. It's still used for microcontrollers, of course, not for CPUs, and it means that you don't have an easy way to read the ROM and extract it to send it to the outside world, because for von Neumann architecture, of course, the ROM and the RAM are in the same address space, so you can use an instruction to read a cell of RAM to read the ROM, actually. It's not possible with the Harvard architecture. So start to think, oh, can we read the ROM? The answer will come a bit later in the talk. And before that, I will zoom on the history. We are museum, so we try to understand how it evolved, actually. It's Texas Instruments. So I don't know if you know, but Texas Instruments, the guy there at the bottom, Mr. Kielby, is the guy who invented the integrated circuit. Well, actually, we found another guy from Intel about the same time, but that's the history as a remember for that. You got a Nobel prize for physics, yes, for that. And of course, it was the start of the development of the microchips. And the first one, of course, we all remember about the 4001 of Intel as the first CPU. But here, this talk is also to say, well, in microcontroller, there is the TMS-1000 family, which is actually the first commercially used microcontroller that was really a success at large scale. So you can see in the early 70s, there were a first trial with another kind of processor instruction set that was used in the data map, very successful calculator and also the Sinclair scientific. And then, well, they learned from that. In that one, it was a very complex instruction set with 11 bits. And then they designed the TMS, and this one was really successful. Here on this side, you see only as application only the games and L games. But if you go for the calculators, you can see here about a selection of main calculators that were already based on the same. So using the same technology, actually, the main usage was calculators. And you can see the whole evolution across the 70s, but it was still heavily used in the 80s. And actually, all of this is based on 4-bit computing. So it was really amazing to say, oh, in the early 90s, there were still devices built in the 70s on that design. So it triggered that need to go into more details. I would speed. And yeah, just a quick comparison. Also, as I told you, the history remembers a lot, the Intel 4001, the TMS 1001 is also very, very interesting. You can see in unit sold, it's very different. And the price was also very, very different because it was designed for the mass market. And as everything was in there, also, the device itself, the calculator or the game was also very cheap to build. For the instructions, it's about the same. You can see there are a lot less registers. We will see how we manage that quickly. So about how to program that. So there is a huge manual. That was a very good source for this. Everything that is in my slide, actually, it's on the website in reference. You can find all the technical documentation and some examples. And what's in that CPU? You have, actually, a very simple register structure. You have only one accumulator. You have four bits. Y, why register that is used to point in the memory in the RAM? And the X pointer, that is only for two bytes long. As you can see, actually, the memory is managed like that. So it's managed like a grid. So you have four lines. So for the X pointer, you can address the rows. And for the Y, you have 16, so four bits. And then there you can address all the columns. And typically, that RAM was used as register. So you can see here, we use it to store it, to store four numbers. And you can do computation on them. If you want to compute, to make some differences, multiplication, division, you have, of course, to implement them using the simple operation you have. So you only have addition, subtraction. You have to implement yourself the other operations. For the rest, you can see program counter. You can see also there is a page address. It's a page memory. So the jumps are only 16, four bits. So it's 64 instructions. So if you need more, typically, you have one K ROM. And you have to manage the paging. So here are the instructions. So you can see only 43 instructions. As I told you, you have the instruction here for the arithmetic. You have some for the input output. You have, of course, addressing, reading and writing to the RAM, some increment decrement. But you don't have, for example, shift operation, logical operation. You don't have that on that device. And so it's not very regular. So you can see the instruction now. So difficult to memorize. This is just one for the addition. So it's well documented. So this typical documentation you can find in the documentation. Of course, if you have a carry, you also have a flag that is set and can manage to propagate and make a computation in the RAM, in the register in the RAM. Quick example, a BCD addition. Because of course, that's usually done in BCD on that device. Actually, you can do it using binary addition. But in some case, you just have to add six if it's larger than nine. So this is the algorithm you can see if you perform the addition in memory. Then if you are bigger than nine, actually, that's 2k. So if you are bigger than 15, you have already a carry on the binary operation. Then you know you are bigger than nine. And then you have an extra test to see if you are bigger than nine. And then you add six. And you can see here in this code here, you will test here if you are less than nine. And then you will have the correction and add it. And then you have a loop. Of course, you will perform the same on the whole register. If you see the example here, it's an addition. We try to add the two in the middle and sort the result in the F register. So X equal two. If you have the row nine, sorry, the column nine, with nine plus seven, you have 16. And then you have two at six. And you can see at the bottom, you have six that is stored. And of course, you have an extra carry that will be used for the next operation. Okay, now let's go inside. So for those who have thought about how to read the ROM, actually there are two solutions. The first one is that there is a test mode that is documented in the patent. And that is used for testing in factory. But it's difficult to use. There is no reported success. So the main way to do it actually is to decap the die and to read, visually read, so to capture the structure. So you can clearly see where there are transistors, where there are not. That means that there is one bit of ROM there to read. And then you can try to rearrange things because it's a bit difficult, but you have to think about, oh, because it's really mixed to rebuild the ROM. And this is the Python script that will do the job for you. And then you get the ROM at the bottom. And then you can typically emulate it. Or you can first also disassemble it. So this is a program to disassemble. And you can also emulate it. So for this, the grid tool to use, of course, is Mem. And if you start it in debug mode, you will have all the tooling. So you will have a disassembler that will show you the code and where you are. And you can see also on the left the ROM. So you have the four lines of 16 nimbals that will help you to understand what happens. And you can see here, it's the little professor that is running. You have that addition 39 plus 62. And you can see on the ROM here, you have the 39 here on that register. You have 62 on that register. And you have the sum here, 101. So it's the other way that has been computed. And it's used for checking. So if you type first one, it will accept. If you type something else, it will immediately display an error. And you can also see here in the code that we are in the code that is performing an addition, actually. So the addition, you can recognize the algorithm I showed you before, because it's the one with the test about nine. And then the correction to add six to make the BCD correction. OK, I will quickly close. So of course, ma'am, I will not go into detail. It has the support for the emulation. For the CPU, you have to import the ROM. It's not distributed. But if you have the possibility to do it yourself using a tool from a visual, you can do it. But usually, it's already available. And there is also a custom layout. You can see here, you can have, that's not common, but you can have custom display in ma'am to have that around the ring. And last but not least, back to our big professor. Well, actually, the design is quite the same. It was not meant, but it's just, as we know, today, it's kind of TMS 1,000 of that type. Of course, we don't have the ROM. We can directly program it. It's better. And it's also interesting because then you can do a lot of more things, rather than strictly emulating the original game. You can also try other games, for example, asking, trying to guess or having a different way to ask questions, not ask about the answer, but if I find a number, five plus what does 10, and then you have to find the other. And you can also have, because that device was not actually very user-friendly. So it tells you how strong it's right, and that's it. You can have more way to reward the kit that is playing by showing, for example, animation, a little Pac-Man, things like that on the lead. So that's what we are currently doing at the museum, to show that from the past and also to show another experience from today. Okay, so a quick look inside. You can see here the Arduino, the lead, and the keyboard with the matrix to read the keys. And that's it. I hope you enjoyed that quick journey in the past and about our work on preserving them. We have, of course, other plans for developing with kits also an app, but that's more like scratch coding, but it's also interesting to do it. And of course, we continue to evolve that, and if you want to see it, it will be on display in our museum soon. Okay, if you have questions, it's welcome.