Hardware, electricity and computing

searching for books and resources about fundamentals of how computer work at the material level and how it is related to driver kernel and software. I want to understand how electricity is transformed into information how it is built engineer into the machine, I want to deconstruct the abstraction that I have before me. demystify the machine and the software.
 
I would suggest starting with an 8 bit CPU based computer. It's simple enough to wrap your head around the whole concept. The fun thing is that today's modern 64 bit computers aren't that different, they still use the same concepts, only much more complex.

8 bit 6502 based computer:
View: https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH


Entire CPU created from scratch:
View: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU
 
Depends on how deep you want/need to go.

The keyword you're looking for is microelectronics - a special expert's subfield of electronics.
It's about how to design electronic circuits you need to get a computer out of basic electronics parts,
mostly those logic gates you already knew, memory (Flipflop),... and oscillators (without a tact everything stands still)
and how those are combined to more complex circuits performing basic operations such as comparations, bitshifts, calculations etc.,
(and how to bring those circuits on a piece of silicon to become a processor).

But before you can go there - if you want go there - you'll need to understand electronics.

physics -> electrical engineering -> electronics -> logical gates (TTL) -> logic circuits (ALUs, registers, memory, multiplexers)

could be a link-chain that may help you.
Depending on the knowledge you already have you may directly join into TTL and ALU

The best way to really understand things is always do it yourself.
The hard way:
Get yourself a small electronics lab with a breadboard, some electronics parts, a microcontroller, its programmer, and (most expensive) a powersupply, multimeter and an oscilloscope to see/measure things.
Maybe you have a local school, university or know somebody with such a lab who may assist you with it.
And experiment.
You'll learn a lot!

I can recommend two books that may get you into this:
The Art of Electronics, Horowitz and Hill, Cambridge Press
and
"Student Manual for The Art of Electronics", Hayes and Horowitz, dito.
A practical lab handbook with lots of experiments including building a computer and program it.

Another way to learn how electricity becomes information - closing the gap between transistors and software - is to learn Assembler.
Not the the ones you find on today's 64bit architectures - those is high-level programming already 😜
As SirDice mentioned: 8bit (or even less)
Go really down! (You want to get down to OSI Layer 1)

When you've figured out:
On most smaller processors (8bit) there are no 'higher' operations like multiplication, especially not division, sometimes not even substraction,
but on those already amazing things can be done.
Cause all you really need is addition, one's complement, and a handful of other small operations to do anything (it's only the matter of memory and speed then.)
With those you can realize the other three elementary arithmetics.
And having those any mathematical function can be substituted by algorithms containing those four basic operations.
Anything else is just to get and set the status/value of memories and registers by algorithms containing those operations.

When you understand
Assembler commands represent machine code which is binary values, placed into a special register that causes certain circuits to be activated, obtain the according operation onto a another binary value - the value you want to check or manipulate - and how combinations of those primitive steps lead to even higher operations ...until such as blathering rubbish within a forum ...

...then your question is answered. :cool:
 
It is reasonably easy to learn how semiconductors work and how logic gates are made from them.

However, trying to learn a CPU from logic gates up is very challenging.
 
This looks like a decent case for an Arduino kit... It's a fun rabbit hole to go down - if you're ready to blow a bit of money on breadboards and capacitors. One word of caution: This is the road that leads to places like analysis of a GPU's mining profitability. (I've been following the news on that, that's how I know some of the ups and downs of THAT). 😏
 
trying to learn a CPU from logic gates up is very challenging.
If you stay restricted to a 'primitive' 4...6bit machine just to grasp the principal concept using TTL-ICs it's doable.
But if we're talking modern 64bit cores, you're right. You'll have to deal with a lot more than 'just' simple logic gates anymore.
Not to mention the features modern CPU have like multithreading, branch predictors,....

But "How does a flying machine works?" does not neccassarily means "building a Space Shuttle" :cool:

This looks like a decent case for an Arduino kit
This is a very good advice! (There are [several] other choices than Arduino - but it could be a start.)
As long as you try to program at least a few lines in Assembler,
since default Arduino programming is done in C (or even C++),
and to really grasp the link between Voltage and Software
in my eyes you shall had manipulated the one or the other register and shifted some bits :cool:
 
Thank you all for your answers, appreciate it, and it will come back to the community... if i'm not too lazy...
Now I know where too start, cause i was a bit confused about that stuff. If I may ask what is the difference between Arduino and raspberry pi is one better than the other and for what or is it just product competition?
 
It is reasonably easy to learn how semiconductors work and how logic gates are made from them.

However, trying to learn a CPU from logic gates up is very challenging.
That is exactly what you do in first half of the Nand-to-tetris course. You begin with a humble emulated NAND gate and use it to build emulated registers, adders, etc. Then you progress to building an ALU and finally a CPU. Yes, it's heavily guided, but I still found it instructive.

There's even a video of how an actual NAND gate was built from NMOS transistors back in the '80s. There are folks who have implemented this computer using an FPGA.

In the second part of the course (which I haven't completed :() You build an assembler, virtual machine, and compiler for a high-level language called Jack.

It does not cover operating systems, though. What you're left with at the end is the equivalent of an '80s personal computer. The PC "operating systems" of the time, like DOS, were really just loaders. They would read your program into memory from some awful media and then jump to its first instruction. They would be completely out of the way while your program was running*. A super interesting side-effect of this is the zero-byte program that actually did something.

* Yes, I know about TSRs. I will not utter such things here.
 
The 6502 is among the last CPUs which were small enough to understand each and every transistor. There are even browser based emulators, have a look here.
 
what is the difference between Arduino and raspberry pi is one better than the other
Neither better nor worse, different.
Raspberry Pis are built on larger and faster Microcontrollers capable of running whole Operating Systems like FreeBSD or Linux.

To start the way I explained those may a bit too large - you could learn the same stuff on your PC.

Grasp
to understand how electricity is transformed into information how it is built engineer into the machine
you don't need a machine doing the things you do with your PC,
you may read it out of books, wikipedia articles, watch the linked videos,
or, if you want to dig really into it, you'd better actually experiment with real electricty and transform it into information "see/measure" how information is represented by voltage.
But I would never recommend to put a soldering iron to your main computer 😁 - not even any electronics measurement devices.
Besides the chances to destroy your system if you're not a pro are high, you won't see nothing useful helping you to understand if you don't know what where to measure and have (very expensive) proper pro-equipment (simply the frequencies are that high you would not get anything on a scope for a couple hundred bucks...)
[DON'T DO IT!]

So better on a very low level (Building simple circuits e.g. a flipflop out of transistors, or a more complex logical circuit out of TTL-ICs.

and yeah, of course you'll find several simulations on the internet doing it virtually,
or doing things like SPICE e.g. LTSpice (but besides you need to learn to use the not trivial software, of course you need to know electronics...)

Or try experiment on 8bit-Microcontrollers.
A good advice are the PIC16 or PIC18 models of Microchip
LARGE community, tons of stuff (circuit examples, programs, websites...anything)

Either way you'll learn.
Enjoy!
 
If I may ask what is the difference between Arduino and raspberry pi is one better than the other and for what or is it just product competition?
Hardware-wise, Arduino can be thought of as building blocks, while Pi Pico is an example of how far you can go with those building blocks...
 
The 6502 is among the last CPUs which were small enough to understand each and every transistor.
I used the Z80 which was simple, too. I still have some in a box in the basement.

If one really wants to get into it, I also have some 74181 ALU chips and its support chips. But if you reaaally want to get into it, I have a number of 74xx logic gate chips, too. Plus breadboards, wire wrap and tools, etc.
 
Thank you all for your answers, appreciate it, and it will come back to the community... if i'm not too lazy...
Now I know where too start, cause i was a bit confused about that stuff. If I may ask what is the difference between Arduino and raspberry pi is one better than the other and for what or is it just product competition?

A Raspberry Pi is not simpler than your FreeBSD PC, with virtual memory and full multi-user OSes. An Arduino typically just runs a "naked" program.
 
I would suggest starting with an 8 bit CPU based computer. It's simple enough to wrap your head around the whole concept. The fun thing is that today's modern 64 bit computers aren't that different, they still use the same concepts, only much more complex.

8 bit 6502 based computer:
View: https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH


Entire CPU created from scratch:
View: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU
This guy's channel is great. He creates some awesome stuff.
 
Regarding logic which exceeds the standard ICs I have started using GALs. I am not sure if they are still available. Later I have switched from CPLDs to FPGAs. With FPGAs you are far away from transistor or gate level design. The FPGA vendors try to lock in their customers by libraries and interfaces to Matlab and so on. Additionally they claim that FPGA design is more software than hardware. This is not true if you have clock domains, timing issues and so on. But it is perfect to lock in customers who just click black boxes together.
 
Regarding logic which exceeds the standard ICs I have started using GALs. I am not sure if they are still available. Later I have switched from CPLDs to FPGAs. With FPGAs you are far away from transistor or gate level design. The FPGA vendors try to lock in their customers by libraries and interfaces to Matlab and so on. Additionally they claim that FPGA design is more software than hardware. This is not true if you have clock domains, timing issues and so on. But it is perfect to lock in customers who just click black boxes together.
It's actually amazing how people learned anything about electronics engineering before the advent/consumer availability of Arduino and programmable boards...
 
There were kits in the 1970s/80s
The Homebrew Computer Club brought out a couple of those then. (If you don't knew it check out which guys came out of it 🤓)
Also the first Apple was brought on the market as a kit to be self assembled (without a case) - chinese sweatshops weren't available yet 😝

This were the days when all people want to do something more with a computer but to consume had to had learn assembler.
And those who learned programming on punched cards became our teachers having no idea why we lazy lads pressing so hard on grasping things like pointers, or seeing no sense in learning logic gates and binary sh#t - ’cause we already came from "assembler is the total shit! don't do it!! never, ever!!! learn [current high level language]!"

...and today explaining people what files and harddisks are (because some internetdisturbance blocked the cloud-access again) you're seen as a hacker *facepalm*
 
It's actually amazing how people learned anything about electronics engineering before the advent/consumer availability of Arduino and programmable boards...
For me it started with reading lexicons as a child. At home we have a pile of books where diodes and transistors have been very briefly explained. Later I have borrowed lots of books about home brew hobby electronics from our public library.

At that time some public garbage collection has been taken place two times a year. In case of the city where I lived it has been almost one week, each day in a part of the city. That weeks have been days of horror for my parents because I took lots of broken TV sets and radios to our home. At the beginning I have used the broken sets to collect resistors, capacitors, tubes and semiconductors.

I have used the components to build up simple circuits as flash lights, audio amplifiers and so on. The break through in terms of interest have been detector radios consisting of a coil, a tunable capacitor and a rectifier to receive AM stations. Later I have build simple receivers to listen to citizen band stations and simple transmitters. I still have been a child. This is how everything developed.

Decades later I have been interested in micro controllers. Therefore I have build a programmer for the famous Atmel ATMega family. A few weeks later one of my sons who has been started using computer, programming in Python and so on has become interested in micro controllers. He asked my how or where to purchase some hardware. Fortunately I have had bought spare parts for the programmer in case something has been damaged. So I asked him if he likes to build up a programmer by himself. It took one weekend to teach him using a solder iron and to build up the hardware step by step. Finally it has been a great experience. At the end of the weekend everything has been up and running and we have been very proud. Today he knows where the good and the dangerous end of the solder iron is. He is much better in programming than me but he also has learned to handle periphery of micro controller boards.

Now this post is about learning about hardware design in case of two generations :). More important is my happiness that all of my children are better than me in different disciplines, characters or so on.
 
Regarding logic which exceeds the standard ICs I have started using GALs. I am not sure if they are still available.
Yes, Atmel GAL22V10 or GAL16V8 for example. I've used these in my own 6502 board for address decoding. Saved me a lot of separate logic gate components. But the software to program these things (WinCUPL) is really old and buggy. Lousy documentation too. Still though, it's been a great introduction in HDL and I've since gotten myself an FPGA development board (CMOD A7-15t) and still on the lookout for a DE-10 Nano (one to experiment with and one to run MiSTer :)).

Ben Eater has been already mentioned.
Yes, his entire channel is awesome, he has a lot more very interesting videos. He explains everything clearly, highly recommended.

There were kits in the 1970s/80s for building your own 6800/6502/Z80 computers.
The most awesome thing about the 6502 and Z80 is that you can still buy these 'old' CPUs, they're still being produced. Which means you can build a 6502 or Z80 system with new, modern components and don't have to source new old stock or second hand.


As for Z80 based systems, the RC2014 project has a lot, you can even run CP/M on it: https://rc2014.co.uk/

If you're not ready yet to buy a bunch of electronic components, I can highly recommend playing with Logisim, project unfortunately has stopped but someone else developed it further: https://github.com/logisim-evolution/logisim-evolution
 
There were kits in the 1970s/80s for building your own 6800/6502/Z80 computers.

In Australia c. 1976 were kits using the Signetics (Philips) 2650 microcontroller, on a well-designed backplane/bus system by Bob Armstrong in Sydney.

2MHz 8-bit CPU, 4kB static RAM, simple bit-banging serial i/o for kbd and printer, a wire-wrapped S100 connector for video board to a small ex-bank monitor.

2kB EEPROM monitor/ BIOS/ "OS" driving a custom 3kB/sec audio storage board using regular cassettes, later floppy disk. Plus two 8kB static RAM boards for 20kB total memory, whoopie!

Another Sydney bloke wrote it a decent line editor and assembler which suited me as a previously mainframe assembly hacker on NCR-315 then IBM S/3{6,7}0.

By 1979, with code and help from the authors of Tiny Pascal (later Tandy TRS-80 Pascal), I'd written it a P-Code "VM" so we had a working (albeit 16-bit integer) Pascal compiler, editor and runtime system as featured in Byte magazine around then.

With the addition of an ancient 50 baud telegraph printer, it served several years at the local Community Centre for mailing address lists, newsletters and such, while entertaining a few mad geniuses.

15 years later I got to play with design and coding a battery cell chsrging system using a pair of Atmel Tiny45s, ah so good to write in raw assembler again, despite the project being abandoned.

Excuse my nostalgia; nothing modern to contribute ...
 
Back
Top