Logisim & cpu's
Posted: Tue Apr 03, 2012 7:19 am
I just found this logisim (free) electronics tool, and a couple of nice CPU examples, one "hard coded", the other microcoded.
The cpus are not "6502" (nor anything else "real", but are good examples for basic cpu principles (at least they seem to be
... me not being any expert, but Professor Toomey, seems to know what he's doing )
Mike
=====================
http://ozark.hendrix.edu/~burch/logisim/
Logisim is an educational tool for designing and simulating digital logic circuits. With its simple toolbar interface and simulation of circuits as you build them, it is simple enough to facilitate learning the most basic concepts related to logic circuits. With the capacity to build larger circuits from smaller subcircuits, and to draw bundles of wires with a single mouse drag, Logisim can be used (and is used) to design and simulate entire CPUs for educational purposes.
---------------------
http://minnie.tuhs.org/Programs/UcodeCPU/index.html
"Warren's Microcoded CPU
Introduction
I wanted to design a microcoded CPU which had a reasonable number of instructions and RAM, but was still reasonably clean and elegant. I've used the microcode logic structure that Mythsim uses, but I've designed the CPU from scratch and implemented it using Logisim.
Download
Here is a Zip file which contains the microcoded CPU as a Logisim circuit, a microassembler and an assembler written in Perl, a text file containing a minimal set of microinstructions, and a sample assembly language file:
microcode_cpu.zip, version 1.1
CPU Overview
The CPU has a 16-bit address bus and a 16-bit data bus. With Logisim, you can only address the 16-bit words as words not bytes. This also means that you only need to add 1 to the PC to move to the next whole-word instruction, not 2. There are 8 general purpose 16-bit registers, an ALU which can do 16 different operations, an instruction register and an immediate register to hold immediate (literal) values.
Each simple instruction is 1-word (16 bits) long with these fields:
7-bit opcode (MSBs)
3-bit t-register (usually the 2nd operand to the ALU)
3-bit s-register (the 1st operand to the ALU)
3-bit d-register (LSBs, usually the destination of the ALU operation)"
======================
http://minnie.tuhs.org/CompArch/Tutes/week03.html
1 Introduction
In this week's tutorial we are going to look at a simple hardwired CPU, to demonstrate that the control logic in a CPU can be built using some simple gates and multiplexors.
The ALU is the same one that we designed last week. It performs the four operations AND, OR, ADD and SUB on two 8-bit values, and supports signed ADDs and SUBs.
The CPU is a load/store architecture: data has to be brought into registers for manipulation, as the ALU only reads from and writes back to the registers.
The ALU operations have two operands: one register is a source register, and the second register is both source and destination register, i.e. destination register = destination register OP source register.
All the jump operations perform absolute jumps; there are no PC-relative branches. There are conditional jumps based on the zeroness or negativity of the destination register, as well as a "jump always" instruction.
The following diagram shows the datapaths in the CPU:
The cpus are not "6502" (nor anything else "real", but are good examples for basic cpu principles (at least they seem to be
Mike
=====================
http://ozark.hendrix.edu/~burch/logisim/
Logisim is an educational tool for designing and simulating digital logic circuits. With its simple toolbar interface and simulation of circuits as you build them, it is simple enough to facilitate learning the most basic concepts related to logic circuits. With the capacity to build larger circuits from smaller subcircuits, and to draw bundles of wires with a single mouse drag, Logisim can be used (and is used) to design and simulate entire CPUs for educational purposes.
---------------------
http://minnie.tuhs.org/Programs/UcodeCPU/index.html
"Warren's Microcoded CPU
Introduction
I wanted to design a microcoded CPU which had a reasonable number of instructions and RAM, but was still reasonably clean and elegant. I've used the microcode logic structure that Mythsim uses, but I've designed the CPU from scratch and implemented it using Logisim.
Download
Here is a Zip file which contains the microcoded CPU as a Logisim circuit, a microassembler and an assembler written in Perl, a text file containing a minimal set of microinstructions, and a sample assembly language file:
microcode_cpu.zip, version 1.1
CPU Overview
The CPU has a 16-bit address bus and a 16-bit data bus. With Logisim, you can only address the 16-bit words as words not bytes. This also means that you only need to add 1 to the PC to move to the next whole-word instruction, not 2. There are 8 general purpose 16-bit registers, an ALU which can do 16 different operations, an instruction register and an immediate register to hold immediate (literal) values.
Each simple instruction is 1-word (16 bits) long with these fields:
7-bit opcode (MSBs)
3-bit t-register (usually the 2nd operand to the ALU)
3-bit s-register (the 1st operand to the ALU)
3-bit d-register (LSBs, usually the destination of the ALU operation)"
======================
http://minnie.tuhs.org/CompArch/Tutes/week03.html
1 Introduction
In this week's tutorial we are going to look at a simple hardwired CPU, to demonstrate that the control logic in a CPU can be built using some simple gates and multiplexors.
The ALU is the same one that we designed last week. It performs the four operations AND, OR, ADD and SUB on two 8-bit values, and supports signed ADDs and SUBs.
The CPU is a load/store architecture: data has to be brought into registers for manipulation, as the ALU only reads from and writes back to the registers.
The ALU operations have two operands: one register is a source register, and the second register is both source and destination register, i.e. destination register = destination register OP source register.
All the jump operations perform absolute jumps; there are no PC-relative branches. There are conditional jumps based on the zeroness or negativity of the destination register, as well as a "jump always" instruction.
The following diagram shows the datapaths in the CPU: