Presentation is loading. Please wait.

Presentation is loading. Please wait.

Compsci 210 Tutorial Four.

Similar presentations


Presentation on theme: "Compsci 210 Tutorial Four."— Presentation transcript:

1 Compsci 210 Tutorial Four

2 agenda Last week homework Sequential circuit - difficult
Lc-3 simulator

3 Exercise 2.8 Determine the truth table for this decoder (Solution on Piazza) CompSci Semester One 2016

4 Two type of logic circuits
Combinational Circuit for computing always gives the same output for a given set of inputs Decoders – convert S into control signals Multiplexers – select inputs and outputs ALU (Arithmetic and Logic Unit) – operations on data Sequential Circuit for storing stores information State machine – coordinate control signals and data movement Registers and latches – storage elements CompSci Semester One 2016

5 Latches The SR Latch (NOR) Consider the following circuit
Q R Q Q S S Q Q S Q Symbol Circuit R S Q Qprev (HOLD) 0 1 1 1 0 0 1 1 ? Q represents current output Qprev represents previous output. (at last time) Not allowed Function Table Why we need “HOLD” state? Although SR LAtch is one of the most important fundamental methods of didgital storage,it is not often used in practice (because of undefined state) - However forms the basis of the more complex latches that we will be dicussing

6 You ought to be able to figure this one out yourself!
Latches The SR Latch(NAND) NAND Form produces similar result from inverted inputs R R S Q 0 0 ? 0 1 0 1 0 1 1 1 Qprev Q R R Q Q Not allowed Q S S S Q Q Hold Function Table Circuit Symbol You ought to be able to figure this one out yourself!

7 Master-Slave Flip flop
Reduce the current noise on the circuit D CK Qcurrent Qnext X 1 At the beginning of each clock cycle Again: To reduce the noise possibility

8 Von Neumann Model

9 Instruction Processing

10 LC-3 an assembly language (low-level programming language)
a type of educational programming language CompSci Semester One 2016

11 Why assembly language Human logic: We are here Circuit:
CompSci Semester One 2016

12 High level languages Assembly language Machine code
CompSci Semester One 2016

13 LC-3 simulator & LC-3 editor
CompSci Semester One 2016

14 LC-3 simulator & LC-3 editor
You can edit your program here using binary code, hexadecimal code and assembly code.  After finish editing, you can export to .obj file which can be run by LC3 simulator.

15 LC-3 simulator & LC-3 editor
virtual computer which execute assembly code Simulator CompSci Semester One 2016

16 LC-3 Notes The simulator and the editor are separate programs
The simulator is available for Windows (also Linux/Java/etc) The lab computers should have LC-3 included The LC-3 software can be executed from a flash drive Download from : Goolge: lc-3 simulator canvas if needed CompSci Semester One 2016

17 The LC-3 Files CompSci Semester One 2016

18 The LC-3 Files After installation, you will see 2 exe programs (windows): LC3Edit.exe and Simulate.exe.

19 LC-3 Editor CompSci Semester One 2016

20 LC-3 Editor The editor is used to enter your LC-3 instructions
You will save your programs into the .asm format The editor will also assemble your .asm files into .obj files which can be run on the simulator

21 example.asm .ORIG x3000 LD R2, ZERO LD R0, M0 LD R1, M1 LOOP BRz DONE ADD R2, R2, R0 ADD R1, R1, -1 BR LOOP DONE ST R2, RESULT HALT RESULT .FILL x0000 ZERO .FILL x0000 M0 .FILL x0004 M1 .FILL x0803 .END CompSci Semester One 2016

22 LC-3 Simulator

23 LC-3 Simulator The simulator is used to execute your assembled LC-3 machine code You will load the .obj files you create into the editor The editor gives you a very detailed view of what is happening as your machine code is executed

24 Lc-3 simulator CompSci Semester One 2016

25 Example: LC-3 ADD Instruction
CompSci Semester One 2016

26 Demonstration Complete the following tasks in LC-3.
Write a program in the LC-3 Editor. Assemble a program in the LC-3 Editor. Load and execute a program in the LC-3 Simulator. Set breakpoints in the simulator to pause execution. Step forward through your executing program one line at a time. Modify a register value during program execution.


Download ppt "Compsci 210 Tutorial Four."

Similar presentations


Ads by Google