张小哥

【Updating】This is an 8bit CPU! WLN08_03

 
Overview

This is an 8bit CPU built with 74 chips! Named WLN08_03, the hardware resources include 32Byte ROM, 8Byte RAM, 8 instructions, classic five-level pipeline, Harvard architecture, adjustable main frequency, entry-level 8bit CPU, suitable for DIYers who want to understand the structure and operating principles of CPU.

 

The project is being updated. Each module is being tested and has not yet been finalized. Please do not make any boards (if you want to do your own research, you can also modify it by yourself). Please stay tuned and follow us for updates!

 

First, let’s briefly talk about the structure of the CPU: there are about 8 separate modules, connected through the databus bus, and the core core controls each module individually.

sys_tick : system clock generation module

alu : computing module

work_reg : work register

prog_rom : program memory

pc/ir : program counter, instruction register, etc.

core : the main core of the CPU, controlling the logic of each module

Other modules are to be added. . .

The working principle needs to be added. . .

q7OVWaTbDdA3jborDYS2ncuBIfUJvmXuVr57akE0.png

WLN08_03 is a simplified version of the instruction set of WLN08_01. It is partially deleted in order to better reproduce it with an independent 74-bit chip. The early WLN08_01 can judge and jump (equivalent to if), but _03 does not have such advanced functions. Only sequential statements can be executed, without branch jumps and ALU comparisons.

WLN08_01 frame diagram:

jGDR1aDAXx7Ai20s8j2JOGkN3rH0OvTO2d4QlJwj.png

 

PROG_RAM

Input: addr[3:0] address selection en: output enable databus[7:0] data output

Function: Store program data, read-only

Principle: Use an 8-bit DIP switch to store one byte. In order to maintain the habit of dialing up to 1 and dialing down to 0, the circuit is designed to output a high level when the byte address is selected, but 138 is the output. The low level is active, so 238 is selected. The top of the DIP switch is connected to the decoder output, and the bottom is connected together and 10K is pulled low to connect to the data output buffer. The address selection part consists of four 3-8 decoders to form a 5-32 decoder. The data output buffer selects 573. LE is always 1 and OE low-level output is valid.

0Hpdv8PDtJnrgvsvR3IBa0dfSv5yNoaCi73GxayE.png

work_reg

Input: addr[2:0] address selection cp: rising edge address latch en: low level output enable read: rising edge read data write: rising edge write data databus[7:0]: data bus

Principle: The working register is composed of 8 573s. The outputs of these 8 573s are all connected to the bus. The read and write part is implemented: first use a register to latch the address. Since the LE of the 573 is a high-level latch data, the OE is a low-level power. If the flat output is enabled, you can use 138 to control OE and 238 to control LE, and use the output enable of the decoder to control reading and writing respectively. Since the inputs and outputs of these eight 573s are connected to the bus, 138 and 238 must ensure that only one is working at the same time.

Read reg timing: addr address provides>cp rising edge latch address data>release databus>read enable

Write reg timing: addr address provides>cp rising edge latch address data>databus prepares data>write enable

vYZdvqSZf3VKshP7bqzn8mpI4PLaECDtJJVGEuag.png

PC: There is nothing to say about this. Two 161s form a hexadecimal counter, and it has a preset number function that can correspond to the jmp jump instruction, and the output is provided to the program memory PROG_RAM.

GJXj5WZy6mmuvHKquBTOvKk6w4xqYyBh3lat2vTt.png

sys_tick: System clock module. The clock source has two selection methods: 555 and MCU. The frequency range is 1hz-10Khz. The frequency output by the clock source is divided into 4 sequential step clocks.

9PHjrayh5DdjvWTi69drIdN42ak70cb8SvSU7NhP.png

The T0-T3 waveform diagram is as shown:

6T8k33AnstERdmTB99JtUvNnKzcx1CqrF2XPn3De.png

ALU: The calculation module has four operation modes: addition, self-increment by one, self-decrement by one, and negation. The principle is self-understanding and will be explained later.

TvZBeXcIOpzFBr1CntiQ42TCPdQoA7s1sSEelxZF.png

 

Current progress: Test the maximum speed and waveform of the SYS_TICK system clock - OK; test the PC counting logic timing - OK; verify the ALU function - OK; test the work_reg function - OK; verify prog_ram - OK.

The verification of each module is OK, and the core module is being designed.

You may not believe it when I tell you. I bought a fake chip from a certain store. The 573 chip was hot and the 02 pin was reversed, which caused the progress to be delayed. . .

That's right, I bought it from Uxin. I cleared mines here. To buy components, it's better to go to Lichuang Mall to buy genuine products (LCSC pays!).

 

CORE design:

Instruction set: Currently, the 10 instructions are designed as follows. Verilog is being written, and the circuit will be designed and implemented later.

t7mTnkemcoTPcFYumuHNAAbT7HZKJAdsrt4dj4pJ.png

 

Testing function:

 

Update slowly. . . . . .

hjECsIv0GaKGtwvdwBK21VnUzs8cOMqEG1TBii9m.png

 

 

 

参考设计图片
×
Design Files
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-14 23:44:11

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号