Unformatted text preview:

Programming Studio #4ECE 190Programming Studio #4• Concepts this week:– C as digital logic– Memory– Von-Neumann ArchitectureAnnouncements• Exam 1: 1/14,1/15,1/16 7:00pm-10:00pm– Practice exam on course website– Exam review Saturday 3:00pm-5:00pm in Everitt 151– Check compass for Exam assignments– Zero tolerance for being in wrong exam room– Zero tolerance for attempts to cheat or circumvent security• MP 1.2 and HW 2 Due Thursday 1/17• Look at the “Student Manual” on the course websiteC as Digital Logic• C is a programming language; an abstract concept. It can’t work in a vacuum.• At the end of the day, some piece of hardware has to do the work.• In C we have operators to say what kind of computation we want to perform:• In the digital logic world, we have AND, OR, NOT, NAND, NOR gates& | ~ >> << + - * / %C as Digital Logic• Digital logic can perform the work required by C operands– What logic would do “~” ?– “&” ? “|” ?– “+” ?– “-” ?• In C we also have branching logic:Textif (condition){ a = b + c;}else{ a = b;}• What digital logic could we use to implement this?C as Digital LogicTextconditionbca+0 1if (condition){ a = b + c;}else{ a = b;}If memory block addressability is 16 bitsQuestions:What’s the address space? How many bits are needed to represent the address?Memory Addressing Review4MBImplementing Memory• Memories consist of memory cells, control logic, and data paths.• Example problem: Given 16 memory cells, implement a 4x4bit RAM. The memory has address, data, write-enable inputs and data output.• How many address lines will this memory have?• How many data lines?1 bit 1 bit 1 bit 1 bit1 bit 1 bit 1 bit 1 bit1 bit 1 bit 1 bit 1 bit1 bit 1 bit 1 bit 1 bitImplementing Memory• Look at memory cells, and decide best way to divide.– In this case, we have 4 addresses (memory locations), so we need to divide the memory cells into 4 groups of 4.• Determine how to route reads to the output. This will probably involve MUXes (or equivalent)• Determine control logic for write-enable signal. This logic should enable the same cells the read logic outputs.• Finally, wire memory inputs to cell inputs for writes.• Check each memory address, and verify that your memory works.– Which cells are used for each address doesn’t matter, as long as you can read what you wrote.Von Neumann Architecture!"!#$%&# '()*+,(#&-# .(/,+0,1#$&2#3&$$## 3# 45#6789,0*(8:;#!"#$%&'()##$("*&+$,"#-&./$x <=(#>;8#?(+@088#@;9(AB0,)=7*()*+,(#,(C(,D#*;#0#);@E+*(,#;,F087G0*7;8#H=7)=#7D#/0D(9#;8#*=(#!"#$%&'($#)$*+#);8)(E*#x I*;,(9JE,;F,0@#);8)(E*#,(C(,D#*;#*=(#);@E+*(,#0,)=7*()*+,(#78#H=7)=#90*0#089#E,;F,0@#0,(#D*;,(9#78#*=(#D0@(#@(@;,1#! <=(#>;8#?(+@088#0,)=7*()*+,(#у#D*;,(9JE,;F,0@#);8)(E*#x &ŝƌƐƚ ĐŽŵƉƵƚĞƌƐ ďƵŝůƚ ŝŶ ϭϵϰϬƐ ǁĞƌĞ ($#)$*+',#-"$#..%&#);@E+*(,D#! K,;F,0@@(9#/1#D(**78F#DH7*)=(D#089#E=1D7)0AA1#);88()*78F#C+8)*7;80A#+87*D#x I*;,(9JE,;F,0@#97F7*0A#);@E+*(D#:(E*#*=(7,#E,;F,0@#LD(*#;C#78D*,+)*7;8DM#089#90*0#78#,(09JH,7*(#,089;@J0))(DD#@(@;,1#!"#$%&'()##$("*&+$-"(."#&#/0$x N(@;,1#ʹ#D*;,(D#90*0#089#E,;F,0@#x K,;)(DD78F#+87*#ʹ#E(,C;,@D#*=(#90*0#E,;)(DD78F#x O8E+*#ʹ#@(08D#*;#(8*(,#90*0#089#E,;F,0@#x P+*E+*#ʹ#@(08D#*;#(Q*,0)*#,(D+A*D#x ";8*,;A#+87*#ʹ#);8*,;AD#*=(#;,9(,#;C#*=(#78D*,+)*7;8#(Q()+*7;8##K,;)(DD78F#+87*<(@E;,0,1#D*;,0F(R'S";8*,;A#+87*K"OT.INN(@;,1NUT NRTO8E+*#9(>7)(P+*E+*#9(>7)(#• 5 Basic Components:– Memory – stores data and program– Processing unit – performs transformations on data– Means to get input from outside world– Means to produce output– Control unit – coordinates operation of above componentsInstruction Cycle• Fetch Instruction• Decode Instruction• Evaluate Memory Address• Fetch Operands• Execute Instruction• Store Result!"!#$%&# '()*+,(#&-# .(/,+0,1#$&2#3&$$## 3# 45#6789,0*(8:;#!"#$%&'()##$("*&+$,"#-&./$x <=(#>;8#?(+@088#@;9(AB0,)=7*()*+,(#,(C(,D#*;#0#);@E+*(,#;,F087G0*7;8#H=7)=#7D#/0D(9#;8#*=(#!"#$%&'($#)$*+#);8)(E*#x I*;,(9JE,;F,0@#);8)(E*#,(C(,D#*;#*=(#);@E+*(,#0,)=7*()*+,(#78#H=7)=#90*0#089#E,;F,0@#0,(#D*;,(9#78#*=(#D0@(#@(@;,1#! <=(#>;8#?(+@088#0,)=7*()*+,(#у#D*;,(9JE,;F,0@#);8)(E*#x &ŝƌƐƚ ĐŽŵƉƵƚĞƌƐ ďƵŝůƚ ŝŶ ϭϵϰϬƐ ǁĞƌĞ ($#)$*+',#-"$#..%&#);@E+*(,D#! K,;F,0@@(9#/1#D(**78F#DH7*)=(D#089#E=1D7)0AA1#);88()*78F#C+8)*7;80A#+87*D#x I*;,(9JE,;F,0@#97F7*0A#);@E+*(D#:(E*#*=(7,#E,;F,0@#LD(*#;C#78D*,+)*7;8DM#089#90*0#78#,(09JH,7*(#,089;@J0))(DD#@(@;,1#!"#$%&'()##$("*&+$-"(."#&#/0$x N(@;,1#ʹ#D*;,(D#90*0#089#E,;F,0@#x K,;)(DD78F#+87*#ʹ#E(,C;,@D#*=(#90*0#E,;)(DD78F#x O8E+*#ʹ#@(08D#*;#(8*(,#90*0#089#E,;F,0@#x P+*E+*#ʹ#@(08D#*;#(Q*,0)*#,(D+A*D#x ";8*,;A#+87*#ʹ#);8*,;AD#*=(#;,9(,#;C#*=(#78D*,+)*7;8#(Q()+*7;8##K,;)(DD78F#+87*<(@E;,0,1#D*;,0F(R'S";8*,;A#+87*K"OT.INN(@;,1NUT


View Full Document
Download Programming Studio 4
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Programming Studio 4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Programming Studio 4 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?