Dive in to the hardware of a computer

  • Thread starter Thread starter ncd5883
  • Start date Start date
  • Tags Tags
    Computer Hardware
Click For Summary

Discussion Overview

The discussion revolves around understanding the process of how code written in C language is converted into voltage signals within computer hardware, particularly focusing on the role of flip-flops and transistors. Participants explore the transition from high-level programming to low-level hardware operations, touching on concepts of machine code and digital logic.

Discussion Character

  • Exploratory
  • Technical explanation

Main Points Raised

  • One participant expresses a desire to understand the conversion of C code into hardware signals, specifically how a simple operation like x=3+4 is processed.
  • Another participant suggests that the inquiry requires extensive knowledge typically covered in multiple college courses.
  • A third participant recommends a book as a resource for further learning on the topic.
  • A detailed explanation is provided about the role of the CPU clock, voltage signals, and logic gates in processing machine code, emphasizing the flow of high and low voltages through circuitry.
  • The explanation includes how numbers are represented as voltage signals in the ALU and how control signals dictate the processing pathways for operations like multiplication.
  • The relationship between assembly language, machine code, and high-level programming languages like C is discussed, noting the abstraction layers involved.
  • One participant acknowledges that the provided explanation is simplified and does not cover all aspects of memory and CPU specifics.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the depth of explanation required, with some feeling the topic is too broad for a simple response. There are multiple perspectives on how to approach the understanding of hardware processes related to programming.

Contextual Notes

The discussion highlights the complexity of computer hardware and programming interactions, indicating that a full understanding may depend on foundational knowledge in electronics and computer science.

ncd5883
Messages
3
Reaction score
0
dear all,
I am not a electronic engineer. i want to understand the basics in which a code written in C language gets
converted to voltage signals inside the flipflop(transistor). basically when i write x=3+4,print x through a C language, what happens inside the hardware? I know the x=3+4 is converted or compiled to 1 and 0 as a text file. how the text file 1 and 0 goes inside as voltage changes. i know i get into the depth, but someone can throw light.

thanks
ncd
 
Computer science news on Phys.org
You are basically asking us to inform you of the contents of several full-semester college courses. I'm a speed typist but that's a bit too much even for me.
 
  • Like
Likes   Reactions: Greg Bernhardt
You have a cpu clock running that produces a square wave of high and low votage. At each rising edge, the wires coming out of the clock become hot, and voltage travels through the circuitry. In the circuitry are various gates which can either allow current through or not depending on which inputs are hot. For example, you may have a gate in which a signal is let through unless 2/2 input pins are hot. That would be a nand gate, which is well known because nand is logically complete, i.e., you can make any logic circuit with just wires and nand gates.

When you run machine code, the code is in memory, in the form of high or low voltages; It's in the mix of this complex dance of voltages flying through gates and wires. The outputs in the memory, connected to wires, and then to gates, can control which pathways are activated and therefore what the CPU does, as well as what it does it with.

When a number is sent to the ALU, it's represented as a set of high or low voltage wires fed into input pins. Using control signals ( fetched from memory the machine instructions in memory ), you can change which paths these voltages take, for example to multiply two numbers, the control signal activates the paths for multiplication, the signals representing the numbers are routed accordingly, and the output is the resulting high and low voltages on the output pins.

We can build computer hardware much like we build programming languages. Complex computer systems are really made from simple components. We can treat a component as a black box that has a simple well defined behavior and forget about how it works, even though it is actually made up of many other components.

Assembly language is an abstraction of machine code in a form more feasible to work with by human beings. It translates into machine code, which are just ones and zeros ( really high and low voltages in some memory module ). C is a high abstraction of assembly language just like assembly language is an abstraction of machine code.

This is really simplified, and I didn't talk about how memory works or the specifics of the CPU and other components, but it basically summarizes how computers work.
 
Last edited:
  • Like
Likes   Reactions: MrWarlock616, CalcNerd, Silicon Waffle and 1 other person

Similar threads

Replies
14
Views
4K
Replies
8
Views
4K
Replies
3
Views
3K
  • · Replies 44 ·
2
Replies
44
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 102 ·
4
Replies
102
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
16
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K