Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# From Atoms to Chess?

  1. Jul 11, 2017 #1
    Hi! :smile:

    There is a wonderful video

    which very briefly explains the progression from atoms to ending up programming a game of chess.

    I would like to understand, very schematically but with substance, what is going on when I program something in C/C++ backwards and forwards, from the screen output down to the atoms, in other words, how a computer works.

    The video is brief however, and I do not understand it fully.

    Do people have other suggestions of summaries, videos, reading material, etc... on how to understand this?

    Last edited: Jul 11, 2017
  2. jcsd
  3. Jul 11, 2017 #2

    Buzz Bloom

    User Avatar
    Gold Member

    Hi formodular:

    I have not yet watched the entire video, but it does look interesting. The "Layers of Abstraction" diagram seems to miss a few things: several (at least two) layers of firmware which I suppose would be a third group in between software and hardware. I also think there are some missing layers between devices and physics.

    Also I don't conceptualize the downward arrow as increasing complexity, or the upward arrow as increasing abstraction. That is like saying physics is more complex than chemistry which is more complex than biology, and biology is more abstract that chemistry which is more abstract than physics. I see each step of this diagram downward arrow as moving from "what" to "how". An algorithm describes/implements how an application does what it does. A program describes/implements how an algorithm does what it does. Etc.

    Last edited: Jul 11, 2017
  4. Jul 11, 2017 #3


    Staff: Mentor

    What you are asking for is tantamount to how the universe works in 10 easy steps. Each layer in your diagram is worthy of a couple of courses at school.

    Even programmers don't know it to the detail that you are asking for.

    My own understanding is roughly:
    - electron behavior is based based on the material they travel through and we discovered semiconductors where one electron flow can control another electron flow. We been able to use it as an amplifier (analog) or as a switch (digital). This is the essence of the transistor, the basic building block of integrated circuits.

    Having a switch means we can now construct logic gates (AND, OR, NOT, NAND, NOR, XOR...), memory devices (FLIP-FLOPS), and more complex HALF-ADDER and FULL-ADDER devices

    From there we can construct larger logic components to do multi-bit ANDING, ORING... and multi-bit ADDING and multi-bit storage (REGISTERS).

    At this point, its useful to note that all math operations can be reduced to addition in one form or another. In computers, this means that all computer math operations are reduced to binary addition. As an example, you might write a program that skips over some instructions using a JUMP operation. The JUMP in fact adds a value to the CPU addressing register which the computer consults to find the next instruction to execute.

    Computers also have various storage conventions for:
    - unsigned shorts, integers, and longs, and
    - signed shorts, integers, and longs, and
    - signed floats, doubles and long doubles
    - characters...

    We develop algorithms to handle these types of data using the binary operations provided by the CPU which are based on ADDING.

    From there on out its pure magic I mean there's a lot more details.... conventions... specialized hardware... to support the basic CPU...

    https://books.google.com/books?id=1... computers work from atoms to display&f=false
  5. Jul 11, 2017 #4


    Staff: Mentor

    I sympathize greatly. I too think that the subject is fascinating. But you're underestimating the difficulty. It takes a lifetime of learning to understand all those layers thoroughly.

    On the other hand, I thihk there's an 80-20 rule you could apply. 80% of the difficulty is understanding the bottom layer in your diagram (the quantum physics). Eliminate that, and you have only 20% of the effort needed to understand. Eliminate the next lowest layer, and it become simpler again by a factor of 5.

    That suggests a learning strategy. Start from the top down, and continue until you run out of energy.

    Here's a second strategy. Learn how to write micro code to implement an instruction set given a set of hardware. That is the one place where you need one foot solidly in hardware and one in software. In your diagram it is called "micro architecture" It is not as difficult as you imagine. I suspect that might satisfy 80% of your curiosity.
  6. Jul 11, 2017 #5
    Very interesting book, library has it, will check it out very soon!

    I am finding the 20% on computers far more difficult than the 80% on quantum physics which I have studied :DD

    I agree with you all, question probably requires an answer 50 different times, each answer giving more depth. I can try to write up an answer here over time for fun starting from nothing and getting to chess as best I can!

    Lets see what the book says!
  7. Jul 11, 2017 #6


    Staff: Mentor

  8. Jul 26, 2017 #7
    A pedantic point - the electrons in a circuit hardly move, the electricity flows as a wave from electron to electron. Rather like sound travels through air at 770mph, but the air hardly moves
  9. Jul 26, 2017 #8


    Staff: Mentor

    and yet we call it electron flow...
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted