Learning (Old) Microprocessor Design

Its a digital era now. Do you know 40 years ago how a computer or microprocessor looks like ? Its not to late to design your microprocessor, the heart of a computer.

A guy create processor from transistor.


Two guys create a TTL micro computer from around 50 logic ICs.


This guy also cool ! I learned a lot from his articles.


A resource for 6502 processor.


A serious book about stack machine also available.



Now let me design my fetch unit state machine. Fun exercise to your brain !

Tcl : Creating Array

Tcl array can be created by set command by specifying its key to array name.

From example above we define array named days with keys containing numbers and text values. If we try to do variable substitution with $days, it wont work. If we do variable substitution with key specified then it will work.

We can have text as array’s key. Tcl array is an associative array.

From sample above we know that a text key is case sensitive (ID is different with id).

Another way to create array is with array set command by passing list of key value pairs as 3rd parameter and array name as 2nd parameter.

Thats all how we create array in Tcl. Bye!

Tcl : for command

For command used on tcl to create looping with syntax below :

for start test next command

for command have 4 parameter. The first parameter is start block where we set an initial value to a variable (usually using set command). Second parameter is test block where we test a variable or condition(will be tested using expr command). The third parameter is next block which usually used to change variable value (can use incr command). The fourth parameter is command which will be executed in loop.

Basic example below , using i as variable :

Continue reading “Tcl : for command”

Tcl lsort command

lsort is a command to return a sorted list based on option. Default option is to sort alphabetically (-ascii) and ascending (-increasing). lsort can also sort numerically using -integer or -real option. lsort can also sort based on a element on sub list using -index option.

There are more options available. Here we will see some examples of lsort in action.

Tcl Octalogue

Octalogue is eight rules that describe Tcl language as found from https://wiki.tcl-lang.org/page/Dodekalogue.

A script is composed of commands delimited by newlines and semicolons, and a command is composed of words delimited by whitespace.
After escapes and substitutions in each word are processed, words preceded by {*} are transformed into multiple words in the command, the first word of each command is used to locate a routine, and that routine is called with the remaining words as its arguments.

Continue reading “Tcl Octalogue”

Tcl Expr command

All in tcl is string, so expr exist as command to evaluate numeric value. On other language like ruby if we write 1+2 <enter> on the irb console will print 3, but thats not the case with tcl.

To get numeric calculation on Tcl we need to use expr command.

Evaluating logical also work with expr command. Examples below.

By remembering Tcl rule : “All is string”, we can conclude that expr result will be string as well.