How can compilers be used to implement logic gates and IDEs?

  • Thread starter Thread starter pairofstrings
  • Start date Start date
  • Tags Tags
    Logic Logic gates
Click For Summary

Discussion Overview

The discussion revolves around the relationship between computer language compilers and hardware implementations, particularly focusing on logic gates and the programming of hardware components. Participants explore how compilers function from a hardware perspective, the process of writing software for fixed hardware, and the concept of bootstrapping in compilers and IDEs.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant seeks references on how compilers relate to logic gates from a hardware perspective.
  • Another participant asserts that compilers are software implementations and do not directly implement logic gates, which are typically hardware constructs.
  • A participant clarifies their question regarding writing software for a computer with fixed hardware components, specifically asking about compiling instructions without an operating system.
  • One reply mentions cross-compiling, indicating that modern development allows for compiling code on different machines without needing to program directly on the hardware.
  • Participants discuss the design of sequential logic circuits, noting that they are typically designed rather than programmed, although programmable logic devices exist.
  • A historical perspective is provided, explaining the evolution from machine code to assemblers and then to high-level languages, highlighting the principle of one-to-one correspondence in early programming.
  • Another participant introduces the concept of bootstrapping, where compilers and IDEs can be implemented using themselves, citing Qt C++ as an example.

Areas of Agreement / Disagreement

Participants express differing views on the role of compilers in relation to hardware. While some agree on the historical context and the evolution of programming languages, others contest the notion that compilers can implement logic gates directly, indicating a lack of consensus on the core question of the relationship between compilers and hardware.

Contextual Notes

There are unresolved assumptions regarding the definitions of compilers and logic gates, as well as the implications of programming hardware versus designing circuits. The discussion also touches on the limitations of early programming methods compared to modern practices.

pairofstrings
Messages
411
Reaction score
7
I want to find out how computer language compilers works from hardware point of view. How logic gates are implemented using compilers? Can anyone suggest me a good reference book or website where I can find this information?
 
Engineering news on Phys.org
pairofstrings said:
I want to find out how computer language compilers works from hardware point of view.
They don't.

Computer language compilers are almost universally software implemented.

How logic gates are implemented using compilers?
They aren't.

The logic functions of logic gates can of course be simulated in computer code (using computer languages and compilers) but the term "logic gate" is usually used for hardware implementations.
 
I am posting this question again because I wasn't clear before in asking my question.
My question is if you are given with a computer in which all hardware components and devices are fixed like in a normal computer then how will you start writing it's software and compile the instructions using any language, let's assume assembly language then how will you compile it. Since the computer you are given with is fresh unit with no Operating systems in it and it just a hardware.
Likewise, if I am given with any sequential circuits how will I program it? Do all the compilers and programming languages are meant to work only on memory devices that is present in the circuit?
I hope I am clear this time with my question.
 
Thankfully, you don't have to. Cross-compiling allows you to compile machine code for one machine on a different machine. 50 years of computer development mean that you no longer have to feed punch cards in real time, program in assembly, or even debug machine code!

Possibly related to your inquiry: the basic, basic pre-operating system in most computers is the BIOS--it initializes the basic hardware and prepares the computer for the operating system to run. And where does the BIOS come from? Nowadays, it's written up on a computer and then burned into the IC at the factory. Once upon a time, it was probably a little more difficult.

Additionally, you don't program (simple) sequential logic circuits: you design the circuit around the function you want it to carry out.
 
Last edited:
MATLABdude said:
Additionally, you don't program (simple) sequential logic circuits: you design the circuit around the function you want it to carry out.
General Array Logic would like it to be known that there are programmable logic devices. :smile:
 
There are plenty of programmable logic devices, and even some that configure themselves on power-up from an EEPROM. That's why I used the (simple) modifier! :smile:
 
While all of the statements in the posts so far are correct, I think they miss the heart of your question. Let me explain it this way.

In the very early days, there were no compilers and no assemblers and all programming was done as string of 1's and 0'. Folks got tired REALLY quickly of writing all those 1's and 0's and the assembler was invented. This was a human readable language with instructions like "add" but there was always what is known as the principle of one to one correspondence. That is, every assembly instruction corresponded exactly to one machine language instruction --- it was just a short-hand for machined code. Assemblers were written in primitive form in machine code and then bootstrapped to more extensive versions.

After a while, folks got really tired of writing hundreds of lines of assembly code to do really simple things, so they decided to drop the principle of one to one correspondence and do a language that was more mathematical in nature with instruction like "a = b + c". These languages were called compilers and they were written in assembly language. Some of them even PRODUCED assembly language which then had to be assembled, others went straight to machine code.

NOW there are, as was mentioned, cross-assemblers and cross-compilers so you never have to write in machine code if you don't want to.
 
The interesting thing about compilers and IDEs is that you can use them to implement themselves.

For example, new versions of Qt C++ are written in Qt C++. Blew my mind when I found out.
 
Jiggy-Ninja said:
The interesting thing about compilers and IDEs is that you can use them to implement themselves.

For example, new versions of Qt C++ are written in Qt C++. Blew my mind when I found out.

Yes, that is called "bootstrapping". The ORIGINAL versions were not written in themselves.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 23 ·
Replies
23
Views
5K
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K