Wuhan University of Technology Computer Composition and System Structure Educoder Experiment


Preface

According to the content of the computer organization principle course, design the corresponding basic experimental teaching program. Among them are data representation experiment, arithmetic unit experiment, memory experiment, and MIPS CPU experiment. This article will improve the previous practical teaching plan and introduce virtual simulation experiments into the teaching classroom.

Experimental data

Platform: Educoder
experimental software: Logisim 2.15.0.2


The following is the content of this article, the following cases are for reference

1. Computer data representation experiment

Level 1: Chinese character national standard code conversion area code experiment

Open the data.circ file in the experiment data package in logisim, and complete the sub-circuit design of the national standard code to the location code in the corresponding circuit. The input pin is the 16-bit GB2312 double-byte national standard code; the output is the area code and bit number (area code and bit numbers start counting from 1), Figure 1.6 is the pin definition of the conversion sub-circuit, please copy the corresponding tunnel label in the circuit When using the signal, be careful not to add or modify the pins, or modify the sub-circuit package, so as not to affect the normal call of the sub-circuit in other circuit modules.

Test result:
Insert picture description here
National standard to zone code circuit
Insert picture description here

The second level: Chinese character machine internal code acquisition experiment

After completing the conversion circuit from the national standard code to the location code, you can test it in the Chinese character display circuit. Try to store the specified sentence given below in the ROM memory in the circuit shown in the figure below. Note that the word-by-word lookup table is not allowed here. The way to obtain the code, should master the method and principle of batch conversion.
Insert picture description here

Example text:
12345 ABCDEFGabcdefg I am leaving gently, just as I came gently; I gently waved goodbye to the clouds in the western sky. The golden willows by the river are the brides in the sunset; the bright shadows in the waves ripple in my heart.

Fill turn GB2312 ROM memory
A3B1 A3B2 A3B3 a3b4 a3b5 a3c1 a3c2 a3c3
a3c4 a3c5 a3c6 a3c7 a3e1 a3e2 a3e3 a3e4
a3e5 a3e6 C7E1 a3e7 C7E1 b5c4 Ced2 d7df
c1cb a3ac d5fd c8e7 C7E1 Ced2 C7E1 b5c4
c0b4 a3bb C7E1 Ced2 C7E1 b5c4 d5d0 CAD 6
a3ac d7f7 b1f0 cef7 ccec b5c4 d4c6 b2ca
a1a3 c4c7 bad3 c5cf b5c4 bdf0 c1f8 a3ac
cac7 cfa6 d1f4 d6d0 b5c4 d0c2 c4ef a3bb
b2a8 b9e2 c0ef b5c4 b9e2 c0ef b5c4 db0000
c0ef b5c4 d1 ac4 d3b0

Level 3: Even parity coding design

Open the data.circ file in the experiment data package in logisim, and complete the even parity coding circuit in the corresponding circuit. The input and output pins of the experimental circuit are shown in the figure. Input: 16-bit raw data; Output: 17-bit check code (16 data bits + 1 check digit), where the check digit is stored in the highest bit. Note that each bit of the input 16-bit raw data has passed the score The threader is led out by the tunnel label and can be directly copied to the drawing area for use.

Insert picture description here

Level 4: Even parity decoding circuit design

Open the data.circ file in the experiment data package in logisim, and complete the even parity error detection circuit in the corresponding circuit. Input: 17-digit check code, the check digit is stored in the highest bit; output: 16-bit original data, 1 bit error detection bit; the input and output pin definitions of the experimental circuit are shown in the figure, pay attention to each bit of the 17-digit check code They are all led out through the splitter using the tunnel label, which is convenient for use in experiments.
Insert picture description here

Level 5: 16-bit Hamming Encoding Circuit Design

Open the data.circ file in the experiment data package in logisim, and complete the Hamming check coding circuit in the corresponding circuit. The definition of input and output pins is shown in the figure. Input: 16-bit raw data; Output: 22-bit check code (16 data bits + 5 check digits + 1 total check digit), note that each bit of the input 16-bit raw data has passed the splitter Use the tunnel label to lead, which can be directly copied to the drawing area for use.

Insert picture description here

Level 6: 16-bit Hamming Decoding Circuit Design

Open the data.circ file in the experiment data package in Logisim, and complete the Hamming verification and decoding circuit in the corresponding circuit. The definition of input and output pins is shown in the figure, input: 22-bit check code; output: 16-bit original data, 1 bit for error detection; 2 bit for error detection; no error status bit. Note that each bit of the input 16-bit original data has been led out using the tunnel label through the splitter, and can be directly copied to the drawing area for use.

Insert picture description here

Level 7: Hamming Code Pipeline Transmission Experiment

In the figure, the Hamming encoding transmission process is divided into 5 stages (fetching, encoding, transmission, decoding, display) similar to the processing process of the CPU instruction pipeline. The blue bar in the middle is the pipeline interface component (there are actually a number of latches/registers inside, used to latch data and control signals). The pipeline interface component provides a synchronous clearing control signal. Try to enable the clock to run the circuit automatically (CTRL +T), observe the information received by the receiver, when a two-bit error occurs, an error will occur.
Try to use the fewest devices to simply modify the circuit so that when two bits are wrong in the decoding stage, the system can automatically retransmit the wrong code (similar to the branch jump in the instruction pipeline), so that the circuit can correctly transmit all data.
Problem-solving idea: When there is a two-bit error, the data in the encoding stage and the transmission stage should be cleared first. This part of the data will cause inconsistent data sequence at the receiving end. At the same time, the data that has entered the display stage should be locked, and the data in the reading stage The address is rolled back to the correct location.
Insert picture description here

Second, the computing device design

Level 1: 8-bit controllable addition and subtraction circuit design

Open the alu.circ file in the Logisim simulator, and use the packaged full adder to design an 8-bit serial controllable addition and subtraction circuit in the corresponding sub-circuit. The circuit pin definition is shown in the figure, and the user can use it directly Use the corresponding tunnel label in the circuit, where X and Y are two input numbers, Sub is the addition and subtraction control signal, S is the operation result output, Cout is the carry output, and OF is the signed operation overflow bit.
Insert picture description here

Level 2: CLA182 four-bit advance carry circuit design

Open the alu.circ file in Logisim, and implement a cascadable 4-bit advance circuit in the corresponding sub-circuit according to the input and output pins defined in the figure. Among them, Gi, Pi are the carry generation function and transfer function, Cin is the carry input, C1~C4 are the carry output, G, P are the group carry generation function and the group carry transfer function.
Insert picture description here

Level 3: 4-bit fast adder design

Use the four-bit advance carry circuit designed in the previous step to construct a four-bit fast adder. The pin definitions are shown in the figure. X and Y are four-bit adders, Cin is carry input, S is sum output, and Cout For carry output, G and P are 4-bit group carry generation function and group carry transfer function.
Insert picture description here

Level 4: 16-bit fast adder design

Open the alu.circ file in Logisim, use the four-bit advance circuit and the four-bit fast adder to construct the 16-bit advance carry between groups in the corresponding sub-circuit, and verify the function of the group advance carry fast adder. , The pin definition of the fast adder is shown in the figure. Among them, X and Y are 16-bit additions, Cin is carry input, S is sum output, Cout is carry output, G, P are 16-bit group carry generation function and group carry transfer function.

Insert picture description here

Level 6: Design of 5-bit unsigned array multiplier

Open the alu.circ file in Logisim, and implement the diagonal-carry array multiplier in the 5-bit array multiplier. The circuit pin definition is shown in the figure, where X and Y are the 5-bit multiplicand and multiplier, P For the product output, the 25 bitwise AND product terms required for array multiplication have been generated by the auxiliary circuit, as shown in Figure 2.21. All product terms are given through the tunnel label, and the user only needs to do it in the given circuit frame Simply connect to complete a 5-bit array multiplier.

Insert picture description here

Three, storage system design

Level 1: Chinese character library memory chip expansion experiment

The following ROM components are available, 4 pieces of 4K 32-bit ROM, 7 pieces of 16K 32-bit ROM, please build a 16K 16 dot matrix Chinese character library with GB2312 Chinese character encoding on the Logisim platform , the circuit input is the Chinese character area number and bit number, and the circuit output is 8× 32-bit (16K 16=256-bit dot matrix information), the input and output pins of the font library circuit to be completed are shown in the following figure. For details, please refer to the storage.circ file in the project file. The left side of the figure is the input pin, which corresponds to the Chinese character location. The area code and bit number of the code, the middle area is 8 32-bit output pins, which can provide a 256-bit dot matrix display information of Chinese characters at one time, and the actual display area on the right is used to observe whether the Chinese characters are displayed normally. The sub-circuit packaging of the font library has been completed, please do not modify it to avoid affecting the subsequent automatic test function.

Insert picture description here

Level 2: MIPS register file design

Use Logisim platform to build a simplified MIPS register file, which contains 4 32-bit registers. The specific pins and functions are described in the following table.
Insert picture description here


to sum up

Thanks for your support, you need to pick up the source project files.
Link: Chong Chong Chong ~
Extraction code: po8c
copy this content and open the Baidu Netdisk mobile app, the operation is more convenient

Guess you like

Origin blog.csdn.net/mo_zhe/article/details/112863011