Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cw3_hb.DOC
Скачиваний:
3
Добавлен:
06.02.2016
Размер:
1.34 Mб
Скачать

4.3 Alu simulation and visualization

Void alu(int cop)

{

window(1,4,80,23);

textbackground(0);

clrscr();

gotoxy(5,17); cprintf("PC");

gotoxy(15,17); cprintf("IR");

gotoxy(42,17); cprintf("Flags");

gotoxy(5,5); cprintf("R1");

gotoxy(35,5); cprintf("R2");

gotoxy(20,12); cprintf("AC");

gotoxy(20,7); cprintf("----------v----------");

gotoxy(21,8); cprintf("!");

gotoxy(25,8);

switch(cop)

{

case 1: cprintf("Addition"); break;

case 2: cprintf("Substraction"); break;

case 3: cprintf("Multyplication"); break;

case 4: cprintf("Division"); break;

case 5: cprintf("Logical AND"); break;

case 6: cprintf("Logical OR"); break;

default: cprintf("Not ALU operation");

}

gotoxy(39,8); cprintf("!");

gotoxy(22,9); cprintf("-----------------");

// get operands and result

window(8,7,23,9);

textbackground(GREEN);

clrscr();

gotoxy(2,2); cprintf("000000000101"); //print 1st operand

window(38,7,53,9);

textbackground(GREEN);

clrscr();

gotoxy(2,2); cprintf("000000001000"); // print 2d operand

window(23,13,38,15);

textbackground(GREEN);

clrscr();

gotoxy(2,2); cprintf("000000001101"); // print result

window(8,19,12,21);

textbackground(MAGENTA);

clrscr();

gotoxy(2,2); cprintf("20");

window(18,19,36,21);

textbackground(MAGENTA);

clrscr();

// load instruction

gotoxy(2,2); cprintf("0001 0 0001 0001"); //print instruction

window(48,19,56,21);

textbackground(MAGENTA);

clrscr();

gotoxy(2,2); cprintf("0 0 0 0");

}

Appendix a general requests to the reports’ preparing

1. Example of the REPORT CONTENTS

Introduction

1 MEMORY ORGANIZATION

1.1 Data representation

1.2 General memory organization

1.3 Read and Write operations

1.4 Integer operand format

2 ALU ORGANIZATION

CU ORGANIZATION

3 VIRTUAL COMPUTER ___

3.1 Architecture of VC

3.2 Instruction

4 Programming in code of VC

5 SIMULATION OF VC

5.1 Memory model

5.2 ALU model

5.3 CU model

5.4 Testing of simulation program

Conclusion

References

Appendix A: Text of program

Appendix B: User Guide

Appendix C: Program definition

Appendix D: English and Russian Glossary

1. Program documentation

1.1 User’s Manual

General Information

    1. The User’s manual should contain the following sections:

  • the aim of the program;

  • Hardware and software requirements;

  • User’s messages;

It’s possible to combine existing sections or to include additional parts.

Sections Contents

    1. The Aim of the program section should contain the information related to the purpose of the program and the essential information about program operation necessary for users.

    2. The Hardware and software requirements section should specify the minimal and/or maximal hardware and software requirements.

    3. The Program execution section should specify the sequences of operations and commands necessary for loading, launching, execution and successful exit of the program. Here should be included the program response to these operations.

    4. The User’s messages section should contain the complete list of user’s messages, their full text and description as well as appropriate user’s actions in responce to these messages.

    5. It’s posssible to add tables, figures,examples and schematic diagrams that may be helpful in understanding of the program operation.

    6. Appendixes to the User’s manual contain all related information that isn’t included to the previous sections.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]