Docsity

Lecture 3: Top Down Design and Instruction Set in AL, Slides of Microcomputers

Partial preview of the text

Download Lecture 3: Top Down Design and Instruction Set in AL and more Slides Microcomputers in PDF only on Docsity!

9/20/6 Lecture 3 - Instruction Set - Al 1

Program Design

9/20/6 Lecture 3 - Instruction Set - Al 2

Lecture Overview

 Top down design  Modular design  Parameter Passing  Stack and Local Variables  Structured Programming

9/20/6 Lecture 3 - Instruction Set - Al 4

Assembler Language

 Greatest Challenge – Where to begin  Answer  Don’t actually program in assembler  Program in a program design language (PDL) and then translate from the PDL to assembler  Pseudo compiling  May even be desirable to write up the algorithm in a PDL and then translate to a high level language (HLL)  Program the algorithm in PDL – much like any HLL

9/20/6 Lecture 3 - Instruction Set - Al 5

Top Down Design

 Also called “Stepwise Refinement”  Iterative Process (ref Fig 3.1 of text) Program

Subtask t1 Subtask t

Subtask t1,1 Subtask t1,2 Subtask t1,

9/20/6 Lecture 3 - Instruction Set - Al 7

Popular Approach to Programming

 Approach is called Top-Down Design and Bottom-Up Coding.  Problem decomposed into levels of abstraction (top-down design)  System implemented by coding the lowest levels first (bottom-up coding)  EX: Word Processor – Code I/O of char first.

9/20/6 Lecture 3 - Instruction Set - Al 8

System Specification

 Before system designed it must be specified  What is goal of system  Let us brainstorm on what is needed to implement a serial interface.  Hardware wise  Software wise

 TIME TO DO THE SPECIFICATION

9/20/6 Lecture 3 - Instruction Set - Al 10

Modular Design

 Current software is modular in design.  Why?  Overall less complex. – divided into subsystems and after levels of decomposition, leaf elements are simple.  Leaf elements are called modules  Software module is analogous to a hardware element – has inputs, outputs and can be “plugged in”

9/20/6 Lecture 3 - Instruction Set - Al 11

Modules

 Module Coupling  How information is shared between one module and other modules of the system.  Tightly coupled – modules share common data areas and both can modify the data.  When there is erroneous data hard to debug  Loosely coupled – module has access to only its own data and not other process can access its data  Data transfers only through I/O interface

Assignment

 Assignment HW 3  Problem 2-35 page 127

 Upcoming HW assignments  HW4 – code the algorithm for reversing the order of the bits using your method vs. one given in class  HW5 – code up your subroutine from 2- 9/20/6 Lecture 3 - Instruction Set - Al 13