Computer Systems Architecture Dr Rob Williams
Total Page:16
File Type:pdf, Size:1020Kb
Computer Systems Architecture Dr Rob Williams Course text: "Computer Systems Architecture - a networ king approach" Edition 2 Prentice Hall, 2006 CSA Ch 01 CSA Computers Fetch-execute cycle Hardware CPU Ar ithmetic Logic Unit Control Unit RISC features ARM processor Pentium Itanium Input-output Parallel communication Ser ial communication Networ king Local Area Networ ks Ether net USB Wide Area Networ ks Other Networ ks Point to point Visual output Memor y Memor y hierarchy Cache and main memory Disk filing Parallel processing Software Operating systems Unix MS Windows Tools Compilers and assemblers Subroutines and stacks WIMPs Users' viewpoints Hardware engineer HLL programmer Systems administrator Systems programmer CSA Rob Williams CSA ch 01 - p 1 Pearson Education (c) 2006 CSA Rob Williams CSA ch 01 - p 2 Pearson Education (c) 2006 1. CSA - the Hardware / Software Interface Computer Architecture? h/w s/w Interaction of h/w & s/w User code myprog.c Software Operating WIN32 API Systems Procedures O/S Ker nel Hardware CPU Graphics Sound Layered hierarchyofs/w on a h/w bed CSA Rob Williams CSA ch 01 - p 3 Pearson Education (c) 2006 8 10 Intel PII NEC 64Mb DRAM 107 Siemens 16Mb DRAM 6 1MbDRAM 10 Motorola 68000 105 256kbbDRAM Number of Intel 8086 104 64kb DRAM transistors 1103 DRAM 103 Intel 4004 102 10 1 1970 1975 1980 1985 1990 1995 2000 Design year 10 Circuit 3mm 2.0mm line 1.0mm width mm 1 0.4mm 0.35mm 0.15mm 0.1 0.1mm? Moore'sLaw oftechnological progress ENTITY decoder8 IS PORT (sel: IN std_logic_vector (2 DOWNTO 0); -- select i/p signals sig: out std_logic_vector (7 downto 0)); -- eight o/p signals END decoder8; ARCHITECTURE rtl OF decoder8 IS BEGIN s<="0000_0001" WHEN (sel = X"0") ELSE "0000_0010" WHEN (sel = X"1") ELSE "0000_0100" WHEN (sel = X"2") ELSE "0000_1000" WHEN (sel = X"3") ELSE "0001_0000" WHEN (sel = X"4") ELSE "0010_0000" WHEN (sel = X"5") ELSE "0100_0000" WHEN (sel = X"6") ELSE "1000_0000"; END rtl; Moder n h/w development: VHDL CSA Rob Williams CSA ch 01 - p 4 Pearson Education (c) 2006 2.048Mbps TIC Tr unk Lines to other Switches System Bus Control Computer TDM Voice Bus Line LIC LIC LIC LIC interface Monitor ing cards ter minal Telephone Switch showing the embedded computer Windows’ file browser CSA Rob Williams CSA ch 01 - p 5 Pearson Education (c) 2006 DLL initialization failure C:\WINNT\System32\KERNEL32.DLL The process is terminating abnormally The local ATM gives an error message %cat .cshrc umask 077 limit core 0 setenvTERM vt100 setenvPRINTER lw set prompt = "`hostname` > " set history=25 biff y mesg n alias tt99 'setenvDISPLAYTT99:0' set path = ( . /usr/ucb /usr/bin/X11 /bin /usr/bin /usr/local set path = ($path /etc /usr/etc /usr/lang /usr/local $home/bin) Unix set up script or batch file CSA Rob Williams CSA ch 01 - p 6 Pearson Education (c) 2006 hyper text WANs DARPA/NSF CERN WWW WIMP LANs Netscape interfaces PSTN Unix + uucp email ftp archie Or iginal sources of the WWW Domestic Dialup PC modem ISP Office Networ k ISP National/Inter national Tr unk Line ISP Sun WWW Ser vice Ser ver Provider The Internet CSA Rob Williams CSA ch 01 - p 7 Pearson Education (c) 2006 ATM Ether Switch Switch Hub Router Inter net Mail server DB server Gateway 100Mbps Ether ATM Ether net Switch Switch Sun Gateway Workstations Ser ver University LAN 8bytes 6bytes 6bytes 46 - 1500 bytes 4bytes Source Preamble Destination Type data payload Error Address Address Check Ether net packetstr ucture Williams R, Computer Systems Architecture,Prentice Hall, Tanenbaum A S,"Str uctured Computer Organization", Prentice Hall, Heur ing &Jordon, "Computer Systems Design and Architecture", Addison Wesley Hamacher,Vranesic & Zaky,"Computer Organization", McGraw Hill Patterson & Hennessy,"Computer Organization & Design: The Hardware/Software Interface", Morgan Kaufmann Buchanan W,"PC Interfacing, Communications & Windows Programming", Addison Wesley CSA Rob Williams CSA ch 01 - p 8 Pearson Education (c) 2006 CSA Ch 02 CSA Computers Fetch-execute cycle Hardware CPU Ar ithmetic Logic Unit Control Unit RISC features ARM processor Pentium Itanium Input-output Parallel communication Ser ial communication Networ king Local Area Networ ks Ether net USB Wide Area Networ ks Other Networ ks Point to point Visual output Memor y Memor y hierarchy Cache and main memory Disk filing Parallel processing Software Operating systems Unix MS Windows Tools Compilers and assemblers Subroutines and stacks WIMPs Users' viewpoints Hardware engineer HLL programmer Systems administrator Systems programmer CSA Rob Williams CSA ch 02 - p 9 Pearson Education (c) 2006 2. CSA - the von Neumann Interitance Input Process Output data data All under programcontrol 0010 0000 0011 1001 Central instr uctions 1101 0000 Processor 0001 0010 Unit 0000 0001 0001 0010 Program 0011 0100 Memor y 1101 0000 1011 1001 Stored programcontrol Computer Application Smar t Card Telephone/credit card Microcontroller Washing machine controller Games Console Interactiveenter tainment Home PC Webinfor mation browsing Workstation Design layouts for circuit boards Office ServerCentral filing on local networ k Mainframe Corporate Database Supercomputer Flight simulation studies Common applications of computers CSA Rob Williams CSA ch 02 - p 10 Pearson Education (c) 2006 from HLL: i=j+k; to assembler mnemonics: mov EAX,[12011234] add EAX,[12011238] mov [1201123C],EAX to machine binary: 0010 0000 0011 1001 Semantic 0001 0010 0000 0001 Gap 0001 0010 0011 0100 1101 0000 1011 1001 0001 0010 0000 0001 0001 0010 0011 1000 0010 0011 1100 0000 0001 0010 0000 0001 0001 0010 0011 1100 HLL, assembler & machine code 1. Data Transfer and Manipulation 2. Input / Output 3. Transfer of ProgramControl 4. Machine Control Categor ies of machine instructions CSA Rob Williams CSA ch 02 - p 11 Pearson Education (c) 2006 HLL Binar y source object Executable file files file Edit Compile Link Load Librar y Errors files Errors RUN Phases of a HLL compiler Source files Object Dynamic Macros librar ies librar ies edit Compile Link Build RUN Code sharing at different phases CSA Rob Williams CSA ch 02 - p 12 Pearson Education (c) 2006 Mod. 1 Mod. 4 Call to Linking code modules Mod. 2 Subroutine Mod. 3 Command Routines HLL source file Edit Decode Analysis Select &Execute Tokenised Errors instr uction Javasource Java file bytecodes javac java Edit compiler inter preter java applet Netscape browser HTML text page Javalanguage interpreters CSA Rob Williams CSA ch 02 - p 13 Pearson Education (c) 2006 409620481024 512 256 128 64 32 16 8 4 2 1 weighting 1 1 1 1 0 1 0 1 1 1 0 0 1 4096 + 2048 + 1024 + 512 + 128 + 32 + 16 + 8 + 1 = 7865 1111101000 0001100100 0000001010 0000000001 weighting 2 3 9 7 0010 x 1111101000 + 0011 x 0001100100 + 1001 x 0000001010 + 0111 x 0000000001 = 100101011101 Binar y to decimal & decimal to binaryconversion remainders written from right to left 00000 10001 11111101 wn 20010 -------- 30011 2)2397 40100 1198 itten do 50101 599 60110 299 70111 81000 results wr 149 91001 74 A1010 37 B1011 18 C1100 9 D1101 4 E1110 2 F1111 1 0 Hex&binar y CSA Rob Williams CSA ch 02 - p 14 Pearson Education (c) 2006 \bits765 | 000 001 010 011 100 101 110 111 \| bi ts\ de c |0 163248648096112 4321 \ hex|010203040506070 -------------- | --------------------------------------------- 0000 0 0 |NUL DLESP0 @ P` p 0001 1 1 |SOH DC1 ! 1AQa q 0010 2 2 |STX DC2 " 2BRb r 0011 3 3 |ETX DC3 # 3CSc s 0100 4 4 |EOT DC4 $ 4DTd t 0101 5 5 |ENQ NAK % 5EUe u 0110 6 6 |ACK SYN & 6FVf v 0111 7 7 |BEL ETB ' 7GWg w 1000 8 8 |BSCAN ( 8HXh x 1001 9 9 |TAB EM) 9 IY iy 1010 10 A| LFSUB * :JZj z 1011 11 B|VTESC + ;K[ k{ 1100 12 C| FFFS, < L\ l | 1101 13 D|CRGS- = M]m} 1110 14 E|SOHOM E .>N^ n ~ 1111 15 F|SI NL/ ? O_ oDE L NUL Null DLE Data Link Escape SOH StartofHeading DC1 Device Control 1 STX StartofTextDC2 Device Control 2 ETX End of TextDC3 Device Control 3 EOTEnd of transmission DC4 Device Control 4 ENQ EnquiryNAK NegativeAcknowledge ACKAcknowledge SYN Synchronization character BEL Bell ETB End of Transmitted Block BS BackSpace CAN Cancel HT Horizontal Tab EM End of Medium LF Line Feed SUB Substitute VT Ver tical TabESC Escape FF For m Feed FS File Separator CR Carriage ReturnGSGroup Separator SO Shift Out RS Record Separator SI Shift In US Unit Separator SP Space DEL Delete http://www.unicode.org ASCII code table CSA Rob Williams CSA ch 02 - p 15 Pearson Education (c) 2006 #include <stdio.h> void main() { putchar(7); } Ring the bell char letter; short count; unsigned int uk_population; long world_population; float body_weight; double building_weight; long double world_weight; Data types AIX OS/2 CDOS PICK CICS PRIMOS CMS RSTOS CP/M RSX/11 MSDOS RTL/11 George TDS IDRIS THE ISIS UNIX LY NXOS Ultrix MINIX VERSADOS MOP VM MSDOS VMS MVS MS WINDOWS Multics XENIX OS-9 Linux Operating Systems 1. Command line interpreter (CLI), shell script or desktop selections 2. Function calls from within user programs (API) Access to O/S facilities CSA Rob Williams CSA ch 02 - p 16 Pearson Education (c) 2006 rob[66] stty -icanon min 1 time 0 ; menu_prog Are you ready to proceed? [ Y / N ] : Unix unbuffered, nonblockedkeyboard #include <errno.h> #include <stdio.h> #include <sys/termios.h> #include <unistd.h> #define TIMEOUT -1 extern int errno; int sys_nerr; extern char * sys_errlist[]; void setterm(void) { struct termios tty; int status; status = ioctl(0,TCGETS, &tty); tty.c_lflag &= ~ICANON; tty.c_cc[VTIME] = 0; tty.c_cc[VMIN] = 1; status = ioctl(0,TCSETS, &tty); if ( status == -1 ) { printf("ioctl error \n"); perror(sys_errlist[errno]); exit(); } } CSA Rob Williams CSA ch 02 - p