Session S1F A NEW LEARNING METHOD OF MICROPROCESSOR ARCHITECTURE Carlos Augusto P. S. Martins 1 , João Batista T. Corrêa, Luís Fabrício W. Góes, Luiz Eduardo S. Ramos, Talles Henrique Medeiros,
Abstract We present a new learning method of microprocessor architecture based on design and verification using functional simulation. Our main goals are improve and optimize the learning process, motivating students to study and learn theoretical and practical aspects of microprocessor architecture, using functional simulators to validate the microprocessor design and to construct knowledge; and develop research activities during undergraduate course. Our method is based on learning, constructivism theory, problem based learning, group projects, design of academic microprocessors as motivation for theory study/learning and verification of designed microprocessors through functional simulators developed by students. To validate the proposed method we analyze two microprocessors and functional simulators: a digital signal processor using ASIP and RISC concepts, and a RISC ASIP home automation processor. They were developed in computer architecture course (computer science, PUCMinas, Brazil) as the application of this method. In the conclusion students and professor analyze the results, highlighting the main differences, advantages and disadvantages of the new method. Index Terms Learning Method, Microprocessor Architecture, Computer Architecture, Functional Simulation.
INTRODUCTION We have been observing in the last years a significant increase in the use and complexity of computational systems, mainly in complexity of specification, design, implementation, verification, programming and learning the theory of these systems. Analyzing computational systems used in the last years and mainly nowadays, we observed many innovations in the architectures and technologies [1] [2] used in their implementations. Among the most important constructive blocks of those architectures, we can highlight the processing element, input and output, and storage (cache, main and secondary memories). However, certainly the most important elements by importance, evolution and complexity, are the microprocessors that now are used as processing elements in almost all computational systems. Considering the microprocessors state of the art we can highlight: i) some modern microprocessors like Pentium III, Pentium IV, Itanium, Athlon XP, Alpha, PowerPC,
R10000, UltraSparc III [3]-[6]; ii) main technical features as high computational performance, scalability, low energy power; iii) main techniques used for obtaining those features like reduced instruction set, pipeline, instruction level parallelism and cache memory of multiple levels [3]-[7]. Analyzing the evolution and the current state of the microprocessors we can highlight some important problems, that were the initial motivation of this work, as: i) increase of the microprocessors complexity, architectural and technological; ii) difficulties in use and understanding of the modern microprocessors technical resources; iii) lack of motivation for theory study and the non application of the acquired knowledge in realistic practical activities; iv) difficulty to teach and mainly to learn the concepts, features, related techniques and examples of microprocessors when the traditional methods, based on theory reading and manual exercises, are used; v) and mainly the deficiencies and inadequacy of the traditional didactic methods currently used in the teaching and learning of microprocessors architecture and its programming using assembly language. Thus, we are interested mainly in the learning of the microprocessor architecture (theory and practice) and in the learning problems caused by the mentioned points (related to methods). Our main objectives are: i) motivate the people for the study and learning of the theoretical and practical microprocessors architecture knowledge, as a way to propose and develop solutions and answers of current and future real questions about microprocessors and its use; ii) analyze the traditional teaching and learning methods of microprocessors architecture and its application in undergraduate courses, considering the opinion and evaluation of students (learners) and teachers; iii) develop a new learning (maybe teaching) method of microprocessor architecture, involving several abstraction levels (microarchitecture, instruction set, operating system, assembly language and high level language); iv) facilitate the learning of basic concepts of the microprocessors, design techniques, techniques that optimize the microprocessors processing power, and programming using assembly and high level languages; v) improve and optimize the learning process, study and learn of theoretical and practical aspects of microprocessor architecture, using microprocessor design and functional simulator development to construct and
1
Carlos Augusto P. S. Martins, Pontifical Catholic University of Minas Gerais, Prof. Informatics Institute and Post -Graduation Program in Electrical Engineering, Belo Horizonte, MG, Brazil
[email protected]
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-16
Session S1F validate knowledge; vi) develop research activities during undergraduate course. Based in the context, motivations and objectives we present a solution proposed for the considered problems, that in this case is a new learning method of microprocessor architecture. With relationship to the inclusion and importance of this work, we highlight that microprocessors are taught or used in several courses in technical area, undergraduate and graduate degrees, as computer science and engineering (electrical and electronic).
PROPOSED M ETHOD Initially we studied and analyzed [8] some methods traditionally used in the teaching and learning of computer architecture [9], and especially of microprocessors [9]. The main features of those methods are: i) instructivism approach, where the apprentice receive theoretical knowledge, a lot of times in a passive way and without an analytic and critical posture; ii) didactic based on the theoretical classes participation, theory reading and manual exercises accomplishment; iii) rarely they use computational tools for aid in the learning process; iv) mistake possibilities in the learning and incorrect understanding of the taught theory, because practical confirmation activities of the studied theory do not exist. The cases worked in the manual exercises not always cover a good part of the possibilities and they demand a lot of work; v) possibilities of mistakes occurrence that are not detected by the students, and can produces the learning of incorrect concepts and mistakes in the analysis of the theory application in real situations. We conclude that traditional teaching methods are based on theory and instruction, where the students many times decorate the theory without analyze and question the solutions and taught techniques, and mainly they are forced to study the theory without motivation and without relating the theory with real world situations and problems. Thus, the apprentice will have deficiency in the theory domain, little analytical and critical vision, and little experience in analysis and synthesis of real cases. In the method foundations definition we considered the behavior and interaction of individuals in the modern world, which is characterized by the technological progresses and the anxiety. Moreover, we observed that traditional methods were created in another time (context), with different characteristics, which currently are not representative and realistic. We conclude that traditional methods and the participants of the learning process had behavior very different from its equivalent ones in the daily modern. Now we present a description of the method, developed based on the analysis of some traditional methods, highlighting the fundamental concepts, main guidelines, and finally implementation and operational aspects. Among the fundamental concepts of the proposed method, we can highlight: i) try to join motivation, amusement, pleasure and learning; ii) the largest focus of the
method is in the learning and not in the teaching, using constructivism approach, where the apprentice construct his knowledge through practical activities and doesn't receive the theoretical knowledge as a ready and definitive object [12]; iii) use of real situations and problems, besides challenges, as motivation elements for the theoretical topics study. Using learning concepts based on problems, Problem Based Learning (PBL) [12]; iv) use of projects as technique of learning aid, allowing the application of the studied or built theory to solve real problems and to verify the acquired knowledge. The projects show real problems complexity, what is not possible with the use of simple exercises; v) use of group works, in this case projects in group, as learning technique; vi) use of the computer as aid tool to the teaching and learning; vii) use of functional simulation as support technique to the teaching and learning; viii) study of the objects in several abstraction levels; ix) use of the internet and WEB technologies as aid or support to the learning. The visual and dynamic aspects of the hypermedia improve the quality of the support material to the study and also the material produced by the students as one part of the activities related to the study, research and project; x) use of papers preparation, as form of verification of the studied theory and mainly, as contact with the science and scientific methods. Main Guidelines Applying the fundamental concepts in the learning of microprocessor architecture, initially in the instruction set level, we elaborated the guidelines, defining and characterizing the main stages of the learning method. Starting with proposition of real problems, microprocessor project, the groups of students should accomplish the specification, design and verification (functional simulation) stages of the microprocessors in the instruction set level. The functional simulation is accomplished using simulators proposed and developed by the students. The main stages of the proposed method are: 1. Initial lecture for presentation of the main concepts and general view of microprocessor architecture. (Teacher lecture or activity) 2. Proposition of the real problem, the microprocessor project, that can be general purpose or dedicated. Each group of students has total freedom to define and to characterize its real problem, based on PBL. (Teacher lecture) 3. Motivation for study theory topics, necessary for the project, for the solution of real problems. The students should notice that they do not still have all the necessary knowledge to solve the proposed real problem, and conclude about the need of studying new theory topics. Later, they should define the theory knowledge that is necessary to solve the proposed real problem. (The teacher support and advice the groups in the analysis and discussion of the theory that is necessary to solve the proposed problem, acting as one motivator and not as one theory transmitter)
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-17
Session S1F 4. Study of the theory related to the microprocessors. (The teacher aid and advice the students in the process of knowledge construction, using classes, lectures and other activities) 5. Project of the microprocessor, with the specification and development (design) phases of the project in one of the chosen abstraction level. There is competition between the activities of theory study and project, because the last may generates new needs in the first. (The teacher aid and advice the groups in this stage, mainly with relationship to the theory application in the project) 6. Presentation and analysis of some microprocessor simulators, with discussion of topics related to the simulation process and software. That is available in the computer architecture course homepage [13]. (Teacher lecture) 7. Development of the microprocessor simulator, with specification, development and verification phases. (The teacher advice the groups in this stage) 8. Verification of the microprocessor project using the developed simulator. The verification of the microprocessor works as general verification of the practical application of the acquired knowledge. (The teacher can advice the groups in this stage) 9. Presentation of the projected (designed) and verified microprocessor using hypermedia format. 10. Preparation of one technical (maybe scientific) paper about the microprocessor designed and the simulator developed. (optional stage) 11. Verification and final evaluation of the project (The teacher accomplishes this stage and if necessary evaluates each group of students individually) In terms of operational aspects, the projects will be accomplished in reduced size groups of students with common interests. Thus, the teacher can advice and aids each group in a more private and specific way. The teacher can define the microprocessors types or give total freedom to the groups. Now, most of the groups have been projecting (designing) microprocessors in the ISA level or in the ISA and microarchitecture levels. With relationship to the computational environment used in the development and verification of the projects, each group can use the programming language and operating system of its preference. However, we highlight that this freedom complicates the maintenance of the verification infrastructure, and the final evaluation of the microprocessor and the simulator. Normally this stage is accomplished by the course teacher. All activities executed or developed by the course teacher are optional, because this method can be used with or without one teacher.
M ETHOD VERIFICATION In this topic we present some results of the proposed method application, that is being used since 1998 in the computer architecture course [13], initially only in the topics related to the microprocessors, of the computer science course in the Pontifical Catholic University of Minas Gerais, Brazil. On those years several microprocessors (ISA level) were designed and validated (verified) using functional simulation, among which we can mention: CISC or RISC general or specific purpose processors. However, we present only two microprocessors specified and designed in the first semester of 2000, its respective developed and validated simulators, and an analysis of the method application results in the students' opinion. The first microprocessor is a DSP (digital signal processor), that presents advantages over general purpose microprocessors in the processing and treatment of analog signals present in the real world. Besides, it can be used in several applications, such as multimedia, radar, telephony, and audio. There are special instructions and components that characterize its functionality. Among then we can mention some components as the multiplier-accumulator, analog-digital converter (ADC), digital-analog converter (DAC), registers banks, and the instructions MPY (multiplication), LDBA (load in the bank of registers 1), STBA (store in the bank of registers 1) and STBB (store in the bank of registers 2). The projected processor presents characteristics of a RISC (Reduced Instruction Set Computer) such as: reduced instruction set (29 instructions), direct execution of all instructions in hardware, maximization of the instructions emission rate, easy decoding instructions, only load and store for access to the memory and presence of a great amount of registers (banks 1 and 2). The microprocessor simulator program, developed in the C++ language using Borland C++ Builder 4.0 compiler for Windows, simulates an ASIP (Application Specific Instruction set Processor). Its use is simple: the user chooses a binary file with instructions that should be executed stepto-step by the processor. The simulator also supplies an assembler that facilitates the programs construction. With relationship to the registers, the processor have: 4 general purpose registers (16 bits): A, B, C and D; 1 accumulator of 32 bits, responsible for receiving results of logical-arithmetic operations, adding them to its current content; 2 control registers of 4 bits that access the contents of the banks through indirect address to the register (they are sharpeners for the registers banks); 1 bank of 16 registers, of 16 non visible bits, directly accessible to the programmer just through the control register of the bank (BK1). The bank 1 optimize the manipulation of the DAC data writings in the buffer of the RAM memory (from 00:00 to 0Fh); 1 bank of 16 registers of 32 bits, not visible directly to the user (they also use concept of indirect address to the register); 1 return register coupled to the program counter, because it just provide a procedure call (CALL). The microprocessor have
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-18
Session S1F internal RAM memory of 4 Kbytes, with 16 bits words, divided in: Input Buffer: area of the RAM memory reserved for the writing of the Analog-Digital Converter, divided in 16 words of 16 bits (00:00 to 0Fh); Output Buffer: area of the RAM memory reserved for the reading of the DAC, divided in 32 words of 16 bits, that will be read by the DAC as 16 words of 32 bits (10:00 to 3Fh); The remaining of the memory can be used for storage of data and instructions. Both buffers can be modified through software, however, it is not a secure operation if we wanted to maintain the data integrity. Like them, they can be modified by the converters, but they demand special cares. The figure 1 shows the interface of the processor simulator.
FIGURE 1 P ROCESSOR SIMULATOR I NTERFACE
The instruction set of this processor is composed by 29 instructions, where an opcode expansion was applied in the code of the instructions. With the expansion, we spent 16 bits to represent all them and without the expansion, we would spend 32 bits. Other important features are: data types, 16 and 32 bits fixed point integer (for simplification floating point was not implemented); bus of 32 bits with ramifications for 16 bits, once the 16 bits registers operate on the less significant byte of the bus; it implement the addressing modes: register indirect (BK1, BK2), immediate (instructions accomplish operations with immediate values) and direct (remaining instructions). Among the advantages and difficulties, we can mention: the process of the microprocessor design supplies a general idea of the planners' main concerns and processors developers. The student, in contact with the microprocessor architecture theory, interested in propose and develop an instruction set, is forced to build a tool that allows vis ualize the operation and validate its proposal. We believed that, in spite of being motivator to build a processor simulator, this step is not totally necessary, considering the main objectives, that is project (design) a microprocessor in the ISA level. Through the project it was possible to improve (accentuate) the learning degree on the approached subject. This was a differential in relation to the other topics that were worked just theoretically, using traditional methods. The simulation
usage is advantageous because it does not demand a sophisticated or high cost infrastructure, besides it is easy to implement in relation to real microprocessor prototype development. However, the simulator implementation consumes time, being subject to mistakes generated by conceptual deficiencies. In spite of test and verify its project, visualizing its operation through simulation, this is a virtual project. It would be desirable that the project was also implemented as a real prototype for functionality and applicability verification. The second proposed and developed microprocessor was an application specific instruction set processor (ASIP) with architecture dedicated for residential automation systems. Based on the idea of intelligent houses that can work with alarms to control the entrance authorization in the residence, programming to light up certain comfortable and even exact hour to lock the windows. The project of the microprocessor, named KMT, began with a proposal of an instruction set architecture (ISA) level adapted for the specific purpose of this processor. It was defined as one Reduced Instruction Set Computer (RISC) microprocessor [2] of 16 bits, with a main memory of 128Kbytes, with 16 bits cells (words), where the program and the data are stored during its execution. As the processor works with 8 bits registers, whenever it makes access to the memory, KMT use a pair of registers to load or to store the data. The defined instruction set is of the LoadStore type, that is to say, they are instructions that make reference to the registers. The opcode of fourteen defined instructions is variable. Branch instructions and memory access instructions, have 3 bits of opcode, while the other instructions (comparison instructions, registers access, I/O operations and program finalization) have 5 bits of opcode. The remaining bits of the instruction are used for definition of registers, memory address or input/output ports. The registers bank is composed of eight registers with defined size of 8 bits (1 byte), two registers are used as accumulator (16 bits), two as program counter and the other four are used as general purpose registers. It also has 4 input/output ports of 8 bits that make the interface with the external world. In the case of this processor, the components of the house that is electronically controlled are: gates, windows, doors, illumination, sound devices and appliances. After the design stage of the KMT microprocessor architecture, where the students looked to study every theory seen in class [14] and in several bibliographies that treat the subject, it came to the verification stage through functional simulation. We defined the C++ language with Borland C++ Builder 4.0 compiler as tool for software coding. Thus, we could obtain a better maintenance and possible evolutions for more robust versions. The simulator, figure 2, can show the current content of the memory, registers and I/O ports for each executed instruction so that the designer can validate the proposed processor.
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-19
Session S1F
FIGURE 2 P ROCESSOR SIMULATOR I NTERFACE
Among the advantageous points seen by the students, we highlight: the importance of extracting the student creativity, resolving a proposed problem, studying the computer architecture theory, but besides, design a microprocessor and develop a functional simulator that facilitates the verification of the proposed and designed microprocessor; This method qualifies the student to understand, with larger clarity, that initially was just seen in manual exercises and that not always increase the student's critical vision with relationship to a certain architecture; Unhappily, also they have been seeing that the simulator implementation since the beginning brings an extra work to the student, that is undesirable for the proposal and objectives of the work defined in the course. Based on that we can find simulators with extremely different patterns, that difficult the understanding and the final evaluation accomplished by the teacher.
CONCLUSION Based in the obtained results analysis we conclude that: i) in the students' opinion the accomplishment of the projects motivates and aids in the theory learning and it shows the importance of that course topic. However, a great part of the students believes that the simulator development generates a great amount of manual work (programming) not directly related with the microprocessors theory. The students approved the use of this new learning method, asserting that microprocessor design and verification using functional simulators motivate, help and optimize learning; ii) in the professor opinion the results were very good, mainly the use of developed functional simulators to verify microprocessor designs and indirectly verify the constructed knowledge, and improve motivation, interest, creativity, learning and performance of students. Some students become undergraduate researchers, and are submitting and publishing technical papers. Thus, our main goals were reached, the proposed and developed method is a powerful and promising learning method. However, we should consider that groups of undergraduate students developed those microprocessors
during one part of the computer architecture course. Thus, we should not be very demanding and rigorous in the evaluation of some aspects of the designed microprocessors. In the method some alterations exist in the expected behavior of the learning process elements (actors), that are the teacher and the students (learners). The teacher's main functions are motivation of the students, as learning advisor, consultant and facilitator during the process of knowledge construction that happens in the development and verification of the projects. Its main function is not more to teach (to transmit) theory knowledge (instructional way), where the student many times is considered a passive element and even of smaller importance, because the main objective in the classes (using the traditional methods) is to transmit the knowledge and not to motivate students to learn or construct those knowledge. Among the possible disadvantages of the method we can mention: i) new and more active posture of students, that requests an extra effort of the students and the teacher; ii) the teacher's tasks and activities changed and they demand a larger dedication of its part; iii) concluding, as every posture and behavior change it demands a time for adaptation of the involved people. Considering our initial objectives we concluded that the students were more motivated for the theory study; the learning was easier and it produced better results; and the new method presented better results than the traditional methods applied in another topics of the computer architecture course. Thus, we consider that all initial objectives were reached. We observed that we can apply this method in other computer architecture topics, as memory hierarchy, and in another courses as parallel computing. Now, first semester of 2002, computer architecture students are using this method in general with memory hierarchy topic and especially with cache memory, accomplishing projects and developing its functional simulators. It would be important to highlight that in some computer science areas the learning is more practical and experimental, as in computer programming. However, a lot of times the practical activities are excessively simple, they don't represent real situations and not motivate the learning. There are some works proposing innovative methods with larger emphasis in projects [15,16]. However, we should consider the differences between develop and verify programming projects and projects related with microprocessors architecture design. Those differences are related with the microprocessors complexity, operational aspects of the projects, readiness and cost of the computational tools for aided projects and abstraction easiness of the involved concepts. Some students of the computer architecture discipline, after the project of microprocessor using this method, become undergraduate researchers in technical areas related to the microprocessors project and they already published some papers [17][18]. Our major contributions are: Proposal and development of a new learning method of microprocessor architecture; use
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-20
Session S1F of research activities (project), microprocessor design, as study and learning approach; creation of a research environment during computer architecture undergraduate discipline; development of educational software; scientific formation and undergraduate research of students. Among the possible future works we can highlight: Experimental evaluation of the method and of the students knowledge, dividing the students in two experimental groups, and using the traditional method in one group and the proposed method in the other; quantitative evaluation of the learning method among the students of the computer architecture course, using research methods with forms and questionnaires. Among the future works some are in development, as: development of a reconfigurable simulator of microprocessor, where we can configure several important parameters of the microprocessor and of the simulator program [19]; and proposal and implementation of one development and prototyping environment of computational systems: parallel, dedicated and reconfigurable [20].
ACKNOWLEDGMENTS Our gratefulness to the Pro-reitoria de Pesquisa e de Pósgraduação (ProPPG) of PUC-Minas for the support and financing of the projects FIP-2000/04P, FIP-2001/29P, PROBIC-2001/112 and PROBIC-2001/113 and also to CNPq for financing. A special thanks to our computer architecture course students for their patience, participation and cooperation.
[12] Goulart, Iris B., "A educação na perspectiva construtivista",2° edição, Editora Vozes, 1998. (in portuguese) [13] Computer architecture discipline, PUCMINAS, 2000, http://www.dcc.pucmg.br/computacao/disciplinas/ac/semestre2_2000/ [14] Tanenbaum, Andrew S, "Structured Computer Organization", 4th ed., Prentice-Hall, 1999. [15] Borges, Marcos A. F. "Uma nova abordagem para o ensino de banco de dados", Anais do VI Workshop sobre Educação em Informática, XVIII CNSBC, pp. 445-453, 1998. (in portuguese) [16] Borges, Marcos A. F. "Avaliação de uma metodologia alternativa para a aprendizagem de programação", Anais do VIII Workshop de Educação em Computação, p.64, 2000. (in portuguese) [17] Freitas, Henrique C.; Martins, Carlos A. P. S., "Processador dedicado para roteamento em sistemas de comunicação de dados", Anais do I Congresso de Lógica Aplicada à Tecnologia (LAPTEC'2000) , set.2000, p. 717-721. (in portuguese) [18] Freitas, Henrique C.; Martins, Carlos A.P.S.," Projeto de processador com microarquitetura dedicada para roteamento em sistemas de comunicação de dados", I Workshop de Sistemas Computacionais de Alto Desempenho WSCAD'2000, out.2000, p. 63. (in portuguese) [19] Medeiros, Talles H; Martins, Carlos A.P.S.,"Proposta e implementação de um simulador reconfigurável de microprocessadores", projeto PROBIC/PUC-MINAS, 2001. (in portuguese) [20] Martins, Carlos A. P. S., "Proposta e implementação de um ambiente de desenvolvimento e prototipação rápida de sistemas computacionais: paralelos, dedicados e reconfiguráveis", Projeto de pesquisa, FIP 2000/04P, PUC-MINAS, 2000. (in portuguese)
REFERENCES [1] Patterson, D.A ;Hennessy, J.L., "Computer Archietctures a Quantitative Approach", Second Edition, San Francisco, CA: Morgan Kaufmann, 1996. [2] Hwang, Kai; Xu, Zhiwei, "Scalable Parallel Computing:technology, architectures, programming", Boston, McGraw-Hill, 1998. [3] CPU Info Center, Berkeley, 2001, http://bwrc.eecs.berkeley.edu/CIC/ [4] A Symposium on High-Performance Chips at Stanford 2000, http://www.hotchips.org/index12.html [5] A Symposium on High-Performance Chips at Stanford 2001, http://www.hotchips.org/ [6] International Symposium on Microarchitecture 2000, http://www.microarch.org/micro33/index.html [7] International Symposium on Computer Architecture 2001, http://www.ee.princeton.edu/~isca2001/ [8] Martins, Carlos A.P.S., "Análise crítica dos métodos tradicionais de ensino de arquitetura de computadores usados em cursos de graduação no Brasil e no exterior", Relatório Técnico LSDC - PUC-MINAS, 2001. http://www.lsdc.inf.pucminas.br/ (in portuguese) [9] Workshop on Computer Architecture Education 2000, http://www4.ncsu.edu/~efg/wcae2000.html [10] Frontiers in Education Conference 1999,http://fie.engrng.pitt.edu/fie99/ [11] Frontiers in education 2000, http://fie.engrng.pitt.edu/fie2000/
0-7803-7444-4/02/$17.00 © 2002 IEEE November 6 - 9, 2002, Boston, MA 32 nd ASEE/IEEE Frontiers in Education Conference S1F-21