1 / 21

Introduction to Computer Engineering

This article discusses the ethical considerations and potential consequences of releasing software that has not been fully tested, including the example of a medical device that caused harm. It also covers key concepts in computer engineering, such as abstraction, number representation, logic gates, memory, and finite state machines.

sbenavidez
Télécharger la présentation

Introduction to Computer Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS/ECE 252, Fall 2016 Kai Zhao Computer Sciences Department University of Wisconsin – Madison Introduction to Computer Engineering

  2. Releasing Untested Software • Boss pressuring you to release software • Every day delay is $1 million in sales • Is it okay to release software not fully tested? • What if it’s a medical device? • A number of patients receive up to 100x the intended dose of radiation therapy in 1985-1987. 3 died as a direct results and 21 died the following years

  3. Ethics Wrapup • Laws • Set of rules with civil and/or criminal penalties • can be enforced by governmental bodies • Ethics • Set of standards, usually voluntary • Discussion • Usually, no clear right and wrong • Choose between competing interests

  4. Recap Story behind Quote of the Day Quote of the Day: “It is a good thing for an uneducated man to read books of quotations.” -- Sir Winston Churchill 1874 - 1965

  5. Operating System CS537 Chapter 1: Abstraction and Complexity • Abstraction helps us manage complexity • Complex interfaces • Specify what to do • Hide details of how Application Program CS302 Compiler CS536 Machine Language (ISA) CS/ECE354 • Goal: Use abstractions yet still understand details Computer Architecture CS/ECE552 Scope of this course Digital Design CS/ECE352 Electronic circuits ECE340

  6. Chapter 2: Number Representation • 2’s complement representation

  7. Chapter 2: Hexadecimal and Operations Hexadecimal table Addition 01101000(104) 11110110(-10) + 11110000(-16) + (-9) 01011000(98) (-19)

  8. Chapter 3: Transistor Supply Voltage Output Gate Gate Output Ground N-type transistor P-type transistor

  9. Chapter 3: Building logic gates from transistors • NOR gate

  10. Chapter 3: implementing truth tables w/ logic gates 1. AND combinations that yield a "1" in the truth table. 2. OR the resultsof the AND gates.

  11. Chapter 3: Memory • R is used to “reset” or “clear” the element – set it to zero. • S is used to “set” the element – set it to one. • If both R and S are one, out could be either zero or one. • “quiescent” state -- holds its previous value • note: if a is 1, b is 0, and vice versa 1 1 0 1 1 0 1 0 1 out 1 out 0 0 1 1

  12. Chapter 3: Finite State Machine A description of a system with the following components: • A finite number of states • A finite number of external inputs • A finite number of external outputs • An explicit specification of all state transitions • An explicit specification of what causes eachexternal output value.

  13. Chapter 4: Von Neumann Model

  14. Chapter 5: LC-3 ISA

  15. Chapter 6: Programming via Iterative Refinement Decompose task into a few simpler subtasks. There are three basic ways to decompose a task:

  16. Chapter 6: Debug by Tracing execute instruction sequences set/display registers set/display memory set breakpoints

  17. Chap7: Char Count in Assembly Language (1 of 3) ; ; Program to count occurrences of a character in a file. ; Character to be input from the keyboard. ; Result to be displayed on the monitor. ; Program only works if no more than 9 occurrences are found. ; ; ; Initialization ; .ORIG x3000 AND R2, R2, #0 ; R2 is counter, initially 0 LD R3, PTR ; R3 is pointer to characters GETC ; R0 gets character input LDR R1, R3, #0 ; R1 gets first character ; ; Test character for end of file ; TEST ADD R4, R1, #-4 ; Test for EOT (ASCII x04) BRz OUTPUT ; If done, prepare the output

  18. Chap7: Char Count in Assembly Language (2 of 3) ; ; Test character for match. If a match, increment count. ; NOT R1, R1 ADD R1, R1, R0 ; If match, R1 = xFFFF NOT R1, R1 ; If match, R1 = x0000 BRnp GETCHAR ; If no match, do not increment ADD R2, R2, #1 ; ; Get next character from file. ; GETCHAR ADD R3, R3, #1 ; Point to next character. LDR R1, R3, #0 ; R1 gets next char to test BRnzp TEST ; ; Output the count. ; OUTPUT LD R0, ASCII ; Load the ASCII template ADD R0, R0, R2 ; Covert binary count to ASCII OUT ; ASCII code in R0 is displayed. HALT ; Halt machine

  19. Chapter 9.2 Subroutines ; CountChar: subroutine to count occurrences of a charCountChar ST R3, CCR3 ; save registers ST R4, CCR4ST R7, CCR7 ; JSR alters R7ST R1, CCR1 ; save original string ptr AND R4, R4, #0 ; initialize count to zeroCC1 JSR FirstChar; find next occurrence (ptr in R2) LDR R3, R2, #0 ; see if char or null BRz CC2 ; if null, no more chars ADD R4, R4, #1 ; increment count ADD R1, R2, #1 ; point to next char in string BRnzp CC1CC2 ADD R2, R4, #0; move return val (count) to R2 LD R3, CCR3 ; restore regs LD R4, CCR4 LD R1, CCR1 LD R7, CCR7 RET ; and return

  20. Chapter 8: I/O Control/Status Registers • CPU tells device what to do -- write to control register • CPU checks whether task is done -- read status register Data Registers • CPU transfers data to/from device Device electronics • performs actual operation • pixels to screen, bits to/from disk, characters from keyboard Graphics Controller Control/Status CPU Electronics display Output Data

  21. Chapter 9.1 TRAPs

More Related