CS 341 Computer Architecture and Organization
Lecturer: Bob Wilson Office: S-3-071 Phone: 617-287-6475 Email: bobw@cs.umb.edu
1
Course Objectives
• In this course, you will:
– Learn computer architecture, organization, and implementation including the concepts of:
• instruction sets, interrupts, serial/parallel ports, digital logic, address/data/control busses, and memory/cache
– Experience developing software for a target host that is separate from your development host – Obtain some hands-on experience with assembly language programming
2
Motivation
• Knowledge of machine architecture, HW, and assembly language is needed for many embedded systems projects:
– Telephone Switching Systems – Internet Routers and Switches – Control Systems for Aircraft, Robotics, etc.
• Developing S/W for target machines other than development host is a valuable skill
3
Introduction
• Syllabus and Lecture Notes
– Web: http://www.cs.umb.edu/~bobw/CS341/index.html – You can access using your own PC or General Use Lab PC
• Required Textbooks
– Linux Assembly Language Programming, Bob Neveln – Digital Principles, 3rd Ed., Roger L. Tokheim
• Optional Text Book:
– C, A Reference Manual, S.P. Harbison & G.L. Steele, Jr
4
Introduction
• The syllabus shows the projected schedule:
– Lectures
• Twice a week
– Exams
• Two Exams during the semester • One Final Exam during finals week
– Machine projects
• Assignments and due dates on web page
– Labs
• Handled separately by another instructor
5
Introduction
• Machine Projects
– Assignment write-ups will be on my website – But work must be done on our UNIX systems! – For some of the MPs, you will work in a team
• Project Teams
– – – – When the assignment says to work in a team of two Work together on the project Each member is responsible for all work done! Don’t just split up the work 2 ways!
6
Introduction
• Labs
– – – – – Labs are separate from the machine projects Labs are done in smaller sections in SAPC Lab One day/week starting next week Find your timeslot based on section number Get first lab assignment from my web page
7
Getting Started
• Stand-Alone PC (SAPC) Lab:
– Room S-3-142 (has push-button lock) – Lab Instructor:
• See syllabus for this semester
– Local access to SAPCs and other hardware or test equipment in the SAPC lab – Remote Access to SAPCs available via a specific UNIX system named ulab
8
Getting Started
• Fill out the CS341 Student Survey on website as soon as possible. • UNIX Account
– Apply for CS341 ASAP! (Science 3rd Floor UNIX Lab) – Edit your .cshrc file to add “module ulab”
• Defines environment variables • Makes it possible to compile and run programs, fetch examples, get necessary files
• Use Sun Blades in UNIX Lab as in CS240
– Use “rlogin ulab” for access to SAPC’s
• Remote Internet access from your/ Healey Labs PC
– Connect to and login on “ulab.cs.umb.edu” directly – MUST use Secure Shell 2 for remote access!
• Don’t use chown, chgrp, or chmod on any of your mp directories or files! That could enable cheating.
9
Getting Started (SSH 2)
• Putty (Officially Recommended by Systems Staff)
– http://www.puttyssh.org (Non Commercial Downloads) – Download: SSHSecureShellClient-3.2.5.exe
• SSH Communications (Recommended by me)
– – – – http://www.ssh.com/support/downloads/secureshellwk Download Non-Commercial Version (.exe for Windows) Or http://ce.uml.edu/sshwinclient.exe Download and Execute Installer executable
• Student Recommended
– http://www.i-tree.org/gpl/ixplorer.htm (Windows) – http://rsug.itd.umich.edu/software/fugu/ (MAC OS X)
10
Getting Started
• You may want to use your own PC as a “front end” to our UNIX systems • This is the way modern SW development environments in industry are set up now • Possible using the SSH Communications secure access software package • Have four windows open on your PC
11
Getting Started
• Four windows:
– Window to local file folder for your source files – Notepad to edit/save a text source file locally – SSH Secure File Transfer to transfer the locally stored source file to the UNIX system – SSH Secure Shell to run UNIX commands
• You are on your own trying this from your own PC! • Don’t send problem reports to “operator” for help!
12
Communication
• You must monitor course web site and your UNIX email account for announcements from me!! • To contact me:
– Office: S-3-071 – Office Hours:
• On my website • UNIX: finger bobw
– Email: bobw@cs.umb.edu – Phone/Voice Mail: (617) 287-6475 (UMB) – or (508) 668-7427 (Home) only if really stuck!
13
Homework
• Locate/Start reading course references:
– Web Based / Linked from syllabus web page
• First reading assignment:
– Neveln, Sections 1.1-1.3 (rest of Chapter 1 for interest only) – Neveln, Sections 2.1 – 2.7 for binary, hex, and decimal arithmetic if you are at all shaky on those – Access/Print and read (using links from my web page):
• • • • User guide to UNIX Systems, Patrick O’Neil The Microprocessor Lab $pcex/pc.handout (using link in the above) $pcex/test.c (using link in the above)
14
Embedded System Example
SCUBA Diving “Computer”
15
Embedded System Example
SCUBA Diving Computer Block Diagram
Water Sensor Push Button LCD Display
Depth Sensor
CPU
RT Clock
Temp Sensor
Program Memory
LOG Memory
16
Embedded System Example
• Diving Computer Software Functionality
– – – – – – – – Automatically turn on when in the water Track/display times and depths during the dive Calculate the amount of Nitrogen absorbed Display the safe remaining dive time Pace the diver’s ascent, e.g. deco/safety stops Record dive data in non-volatile log memory Keep track of surface interval before next dive Keep track of safe time before flying
17
Embedded System Example
• Team 1: How would you develop and install the software in the diving computer? • Team 2: How would you test the software in the diving computer?
18
Embedded System Example
• What are the possible consequences of bugs in the diving computer software?
– Diver gets the “bends” – Diver dies
• YouTube video:
http://www.youtube.com/watch?v=eNqPTOb31S8&NR=1
19
The “Big” Picture
Sun Blade (OS is UNIX) ulab (OS is UNIX)
SAPC’s in S-3-142 (OS is “Tutor” not UNIX)
COM2
IBM Compatible
emacs or vi
mtip
COM2 COM1 COM2 COM1 COM2
IBM Compatible IBM Compatible
IBM Compatible
Putty/SFTP or SSH Communications via Internet
Reset Server
20
The “Big” Picture
• UNIX system is your “development host” • SAPC is your “target machine” • SAPC does not normally have its keyboard, video monitor, or mouse attached! • SAPC COM1 and COM2 ports are cabled to a local terminal or to ports on the UNIX host “ulab”
21
The “Big” Picture
• You will use a UNIX system to edit your source files, compile and assemble them. • You will use the UNIX system as a server for downloading code to an SAPC • You may be using an SAPC
– Locally in the SAPC lab via a terminal attached to one of its COM ports – Remotely via the UNIX system named “ulab”
22
Picture of mtip “Session”
ulab You mtip
Transparent Relaying of Tutor commands
SAPC
Tutor
~d ~r
file.lnx Memory
Reset Server
23