Jump to content

Why not hardwire software ?


oldtobor

Recommended Posts

Thinking about various threads here and there talking about inefficient modern software, has anyone ever though about hardwiring large chunks of software directly onto the CPU chips ? After all chips today contain millions of transistors, why not hardwire a linux kernel and a office word and internet explorer directly into hardware ?

 

Would it be so difficult ? after all these chunks of programs are quite standard and stable, maybe introducing 5 or 6 megachips that have a large piece of standard software all hardware made could really improve things!

 

Does anyone think there are real technical limitations to what I imagine ?

 

What I was thinking about is the basic-fundamental parts of code that don't change. The basic Unix/linux kernel has remained the same for years as has the basic perl/intepreter-compiler or Word/excel, at least the most common and standard things. Why not just hard code those parts ?

 

Actually I'm starting to be convinced that it is a good idea! Take the awk95 programming language. It is only 200K in size which would mean 1,600,000 bits or considering all the overhead maybe 20 million transistors. Pentiums can have 100 million transistors so even a hardwired awk on chip would only occupy 20% of the chip. But then after, all the software could be directly coded in awk completely bypassing assembly language! Now that would be interesting. In the early 80s they had BASIC in ROMs of only 4k or 8K so it is conceivable to just hardwire the whole language and directly program the CPU in a high level language and build up all the complex applications starting from a higher level!

 

If a language is hardwired, the architecture of the CPU could be optimized for the language. I would hardwire the following languages:

 

1) C

2) C++

3) FORTRAN

4) COBOL

5) BASIC/VISUAL BASIC

 

so you don't have to rewrite all the code of these languages.

Actually Gates was quite clever when he squeezed a BASIC interpeter in 4K ROM. Those are the kind of things that they should try to do today only directly implementing it in hardware!

 

There are ALOT OF DIFFERENT WAYS to "hardwire" a language. What I thought was a completely NEW CPU design that completely does away with the assembler language op-code design and just implements all the language constructs directly in the chip. Therefore NO COMPILER, NO INTERPRETER, NO OP CODES only a pure ideas machine. Like a register would have the FOR function control another would have the NEXT etc. The best way to start is to implement a small BASIC language CPU. An ASIC design could be fine. Anyone who has some time and has a copy of some small tiny basic or 8k basic and knows VHDL can try to do it for fun.

 

Must be very inventive and creative. It is more a RESEARCH idea than anything. After all in 1975 who would have ever thought of implementing bill gates BASIC interpreter in 4K ROM ? I think that we MAY not be using the millions of transistor on CPUs in the best possible way. Alot of research probably has been done towards studying alternative CPU designs. It is really just intruiging that 30 years ago we could put an interpreter in 4K, so maybe with a few million transistors we could possible organize chips to directly understand even a simple Basic like language.

 

The goal is not speed but simplifying software. A CPU that can only be programmed directly in a BASIC variant simplifies everything, there are no longer compilers, and it is easy to debug. I would add all those funky features of PERL like associative arrays, regular expressions etc.

 

In our CPU there are no longer opcodes but direct high level instructions. The logic circuits take care of understanding them and activating registers and counters etc. It is a true IDEAS machine that bypasses all we have always taken for granted in CPU design. With millions of transistors available I think it is feasable. Then we only have ONE FUNKY HIGH LEVEL LANGUAGE that takes care of all, all software is built up starting from a higher level.

 

You have a register group that takes care of the FOR instruction, another for the NEXT another for the GOTO etc. You just write the program, the chip reads it from RAM and immediately executes it. No more debugging nightmares or incompatible software. Of course industry and academia may not really want to simplify software for "cultural - economical" reasons....

 

I think I would approach the problem in a much simpler way by simply implementing a high level instruction set for the CPU. So as you have a typical subtract instruction that is composed of an opcode and 2 operands, you could have a FOR NEXT instruction that is made up of an opcode and 2 operands saying the start (I=0) and end (TO 50) (and maybe a 3rd saying the step). Or you can have a string accumulator like PERL $_ and regular expression instructions, and maybe SQR and RND assembler level instructions etc. You could end up having an almost 1 to 1 correspondence between a high level language and it's underlying assembler translation. Anyways in this research I would start out simple, implementing an equivalent 4K ROM BASIC like instruction set for the CPU and then extend it. Start with VHDL and ASICs. You might want to also look up to see if a SOFTWARE TO HARDWARE CONVERTER exists or could be designed. Take any small program and the converter could convert the entire program into a bunch of combinational circuits.

Link to comment
Share on other sites

Yeah, unless Microsoft started making hardware, or Sun, then they would probably start doing that. It's a very good idea. It would make booting up so much faster and save HD space. Hey, I think you started me on my next project for school. Thanks.

Link to comment
Share on other sites

Sounds like an embedded systems discussion to me.

 

Wikipedia has a good introductory article on the subject, including discussion of the pros and cons and why you don't see that approached used in general purpose (desktop/laptop) computing:

http://en.wikipedia.org/wiki/Embedded_systems

 

Windows CE and Palm OS are good examples of embedded general-purpose operating systems.

 

Microsoft has a page on embedded systems, as part of their initiative in getting "Windows" into all aspects of consumer electronics.

http://msdn.microsoft.com/embedded/default.aspx

 

It's interesting to note that this approach was not used by Microsoft in their "Media Center" version of Windows. The "pro" from their perspective would be that CE is more closed and controllable system, but the "con" is pretty obvious -- CE wasn't written for the wintel architecture.

 

Tivo is a good example of Linux used as in an embedded approach in a mainstream (wintel) PC.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.