1.36k likes | 1.51k Views
Lab 2 Outline Presentation Using CS2204 Lab & Engineering Fundamentals Engineering Environment Fundamentals Digital Design Trends Digital Design Techniques Using Term Project (pages 1 – 7 ) The term project operation The input/output relationship ≡ Purpose ≡ Game rules
E N D
Lab 2 Outline • Presentation • Using CS2204 Lab & Engineering Fundamentals • Engineering Environment Fundamentals • Digital Design Trends • Digital Design Techniques • Using Term Project (pages 1 – 7) • The term project operation • The input/output relationship ≡ Purpose ≡ Game rules • Individual work • Programming the FPGA chip • Learning the rules of the game • Playing the three different versions of the Ppm game • Understanding the concept of the machine player strategy • New Handouts • Term Project Read also next slide CS 2204 Spring 2014
While waiting for lab to start, do the following : • Reserve seats for your partners • Make sure there are enough seats next to you • Only the last group arriving to the seats are on two rows • These two rows are rows 2 and 3 and the seats are near the wall • Login to the LABS domain • Create a CS2204 folder on the S drive and on your laptop • If you cannot login nor see the S drive go to 337RH after this lab • Take a look at the course web site : • http://cis.poly.edu/cs2204 • Download this presentation and term project files to your CS2204 folder • If you have not formed a team, look around to form a team and sit next to your partners if you can CS 2204 Spring 2014
Engineering Environment Fundamentals • Engineering Environment, especially the digital engineering environment, is demanding • Technology advances rapidly • A very dynamic environment • Constant learning • Constant adaptation • Global team work • Even experienced engineers can be stressed out • Students need to keep this in mind and getready for that environment CS 2204 Spring 2014
Engineering Environment Fundamentals • Companies ask job candidates • Can you adapt ? • Are you flexible ? • Are you a team player ? CS 2204 Spring 2014
Engineering Environment Fundamentals • Students need to take the advantage of their college study to be ready • Students need to learn how to learn fast • Students need to have a solid technical foundation • Students need to practice interacting with people • Their peers, senior people and junior people • This is often summarized as communication skills, but it is more than that CS 2204 Spring 2014
Taking the Advantage of College Study • Each course and professor are different, students adapt to the course and professor • Differentcourses and professors help students • Learn how to learn in a short time period • Gain the technical foundation of their area • Learn how to interact with people • Labs are a good medium to acquire them CS 2204 Spring 2014
Today’s Engineering Environment • Globalized • Tightdeadlines • Tightbudgets • Managers and employers seek for two points • Are you systems oriented ? • Can you relate parts ? • Can you solve problems ? CS 2204 Spring 2014
Are You Systems Oriented ? • On a global scale ? • They want to see that not only that • You know your part (block) of the system (black box) but other parts (blocks) and • You can relate all the parts • But, you need to be prepared for that • This can be an opportunity to prove yourself ! • You can say “No“ ! • But, it should not be the following • “My job is only this part (block) ! I do not know the other parts” CS 2204 Spring 2014
Can You Solve Problems ? • On a global scale ? • You are expected to say “Yes, I can do it” • But, you need to know how to approach solving problems ! • Studying past exams is not a good practice to be ready • Do not be afraid of taking on problems • Do not be afraid of learning more • This can be an opportunity to prove yourself ! • If you are systems oriented, it is easier to be a problem solver • You can say “No“ ! • But, it should not be one of the following • I cannot do it ! • I do not know about it ! • I never learned ! CS 2204 Spring 2014
Today’s Engineering Environment • These two points become even more important when there is an economicrecession which forces companies • To outsource • To reduce staffing • While they manufacture about the same number of systems CS 2204 Spring 2014
Engineering Environment Fundamentals • Technical Performance is not everything • Especially as you become more senior • You will supervise junior engineers • Junior engineers will look upon you • Non-technical skills means one knows what to do how, where and when • First thing first, be patient (cool) and do not lose temper • In addition, senior engineers need to • Speak well • Be good listeners • Inspirational • Motivational • Firm and fair CS 2204 Spring 2014
Engineering Environment Fundamentals • Do not take anything that is not earned • Respect intellectual property (IP) • How would you feel if it was your IP ? • But, do not be on a one-person crusade • Do not be : “I do my work and do not need anyone” • Perhaps today ! How about tomorrow ? • We are not machines • We all need each other CS 2204 Spring 2014
Engineering Environment Fundamentals • Help others • No one can survive alone • Communicate with people around you • Practice it • You will need it when you are a senior engineer • Help before you ask for help CS 2204 Spring 2014
Engineering Environment Fundamentals • Find the balance between working hard and helping others • Hint for success • Smile • As a senior engineer/project manager/supervisor you need to be approachable by junior engineers • Have you smiled today ? • If no, why ? CS 2204 Spring 2014
CS2204 engineering environment • Problem solutions for systems • Keep focusing on the big picture • Technical and non-technical dynamics • Learn/practice with teammates, TAs and the professor • Do not ignore the non-technical side • Team-oriented labs and homework • Rules and regulations to acquire technical and non-technical skills • The professor and TAs are the project manager and senior engineers and students are junior engineers CS 2204 Spring 2014
College Training for Engineering Environment • Take the advantage of your courses to learn and improve engineering environment basics • By training yourself in similar situations • Would you arrive late to a team meeting as an engineer ? • Do the same with your partners ! • Would you complete your project assignment late ? • Do the same for your term project ! • Would you argue with your project manager ? • Discuss with your professor ! How, where and when ? Be patient, do not lose temper CS 2204 Spring 2014
Digital Design Trends • Current digital design techniques • Top-down design • Team-based design • Core-based design CS 2204 Spring 2014
Top-down design • One does not start with gates and FFs • One does not start with chips and PCBs • One starts with simple concepts, few details • Gradually adds more details until all the details are obtained • All the gates and FFs and their interconnections • The design is done layerbylayer • A layer implements the layer above • Upper layers are simpler than lower layers • A layer is less complex than the layer below • A layer is built on the layer below … CS 2204 Spring 2014
Top-down design • Layered design • The design is done layer by layer • The design starts with the top layer, the simplest layer • Aftercompleting the top layer moves down the layer below • There are more details on the 2nd layer • Then, the next layer below with more details • The design completes with the bottom layer ! The simplest level : Start with this level … The most complex level : The last level to work on CS 2204 Spring 2014
Top-down design • Block-based design • Structured design • A layer has a number of blocks/components • Upper layers are simpler than lower layers • A layer has less details than the layer below • A layer has less number of blocks/components than the layer below The simplest level : Start with this level … The most complex level : The last level to work on CS 2204 Spring 2014
. . . Digital product as a black box . . . Inputs Outputs • Block-Based Design • One starts the design of a complex circuit, by considering it as a black box • This is the top layer that has just one block, the black box ! • The internal components, details, are ignored • Dealing with many details in the beginning is frustrating and time consuming • Deal with simplest issues first, the top layer : • The input/output relationship, design goals and technology • of the black box is studied CS 2204 Spring 2014
Block-Based Design • Once familiar with the input/output relationship, we break it up into simpler blocks and study each block separately satisfying • The input/output relationship, design goals and technology • One continues to partition (sub)blocks until each one is so simple one can design it very quickly by using gates and FFs • One moves down layer by layer and increases the number of (sub)blocks (details) until there are only gates & FFs • (Sub)blocks can be designed and testedseparately at the same time • Proceed partitioning and testing until a (sub)block is completed . . . . . . Inputs Outputs CS 2204 Spring 2014
CS2204 Top-Down Design • The term project is just one black box in the beginning of the semester • All we will be concerned about is its operation, the input/output relationship, that is how to play the game • Today we will study the input/output relationship • The black box will then be partitioned into six blocks : • Control Unit • Input/Output • Human Play • Play Check • Points Calculation • Machine Play • These six blocks are partitioned into subblocks and so on CS 2204 Spring 2014
Current Digital Design Techniques • Top-down design • Team-based design • Even if top-down design is used, today’s digital circuits cannot be finished by the projected completion time unless a team of people designs it in parallel • Expected introduction of the product to the market • Time-to-market (TTM) : 18 months typical • The work starts with the first team meeting where the top level view of the product is given by the project manager ►The black-box view & the input/output relationship (operation), designgoals, technology CS 2204 Spring 2014
Team-Based Design • Block-based design fits well since each team member can design a separate block • TTM is divided into periods of work or project phases to make sure team members are synchronized • Time is saved • However team members mustcooperatewell for an acceptable product • Team-based design can be inefficient if members do not know each other’s block • For example there can be duplicated circuits ! • This is what we call it being systems oriented CS 2204 Spring 2014
Team-Based Design • CS2204 team-based design • 3- or 4-student teams are formed in the beginning of the semester • There are six project phases which are called experiments • Experiment 1 through Experiment 6 to make sure team members understand all the blocks and each other’s block • Also learn new subjects to complete the design • TTM is May 2, 2014 ! CS 2204 Spring 2014
Current Digital Design Techniques • Top-down design • Team-based design • Core-baseddesign • In today’s competitive digital product market, top-down design and team-based design are not enough to be ahead of the competition • A complex block is licensed from another company • Intellectual Property (IP) is licensed • Time is saved CS 2204 Spring 2014
Core-Based Design • The most difficult block is identified • The team searches around the world to see if there is a company that has a product similar to the block that can be licensed • The team makes sure the licensed product satisfies • The input/output relationship, design goals (speed, cost, power, etc.) of the block and technology • The company is asked for licensing in return for a one-time fee or for a percentage of each product sold • The licensed block is called core since it is the most complex part and the remaining ones are designed ‘around” the core • The remaining, simpler, blocks are designed by the team members CS 2204 Spring 2014
Core-Based Design • CS2204 core-based design • Student will design only one block out of six blocks • The Control Unit Block : core • The Input/Output Block : core • The Human Play Block : core • The Play Check Block : core • The Points Calculation Block : core • The Machine Play Block : non-core • The Machine Play Block uses all other blocks except the Human Play Block CS 2204 Spring 2014
Lab Grade • Students receive a labgrade • 5% of the term grade • Lab work • Lab attendance, arrival, departure • Concentration on lab work • How well he/she cooperates with the teammates • Term project (Experiment 6) grade based on the Term Project Check List handout • Arriving late would delay the team work • Also, teammates cannot synchronize well • If this happens frequently, the team member would fall behind the teammates • Exam grades would go down as well • Labs affect the term grademore • Labs are on all exams • Labs reinforce lecture topics CS 2204 Spring 2014
Lab Grade • Calculating the labgrade • 5% of the term grade • Term project (Experiment 6) grade based on the Term Project Check List handout : 80 • Lab work : 90 based on • Lab attendance, arrival, departure • Concentration on lab work • How well he/she cooperates with the teammates • The lab grade : (0.90 * 0.80) * 5 = (0.72) * 5 = 3.6 • Labs affect the term grademore • Labs are on all exams • Labs reinforce lecture topics CS 2204 Spring 2014
Developing the term project • A student who has fallen behind • Lectures • Labs • Homework assignments • cannot develop the term project ! • When it is week 11, 12, 13, you may realize you cannot design the machine player ! • It is too late ! If a partner falls behind the team falls behind CS 2204 Spring 2014
The Term Project,Ppm • The term project game is human vs. machine • Player 1 : human, Player 2 : machine • When the game starts • Three random digits are generated • A 2-digitcode is generated • After the random digits and code are generated • Player 1 has the turn • Then Player 2 plays, then Player 1 plays, and so on… • Unless a player has an adjacency, then the player plays again ! • The game continues until one has more than (255)10points • Game is restarted by resetting CS 2204 Spring 2014
Digilent NEXYS-2FPGA Board Xilinx Spartan-3E FPGA chip Power switch USB cable must be connected to this port 7-segment displays LED lights Push buttons Slide switches CS 2204 Spring 2014
The Xilinx XLA5 FPGA board • The board circuits • FPGA and its associated circuitry • Placed around the FPGA chip • We should not touch the FPGA area • I/O devices • Switches, push buttons, LED lights and 7-segment displays as well as • Serial, VGA,PS/2 and other ports • Memory chips • There are two memory chips on the board a 16-Mbyte Flash EPROM and 16-Mbyte SDRAM CS 2204 Spring 2014
The Term Project, Ppm • When a player has the turn, a binary-coded decimal (BCD) random digit (RD) is given • 0 ≤ RD ≤ 9 • The player has two options • Play the random digit • Skip the play, so the opposing player gets the turn • The skipping player does not lose points • The opposing player gets a new random digit CS 2204 Spring 2014
The Term Project, Ppm • Playing the random digit means • Play RD directly on a position (overwrite it) • Add it to a position display • The result of direct playing/addition is stored on the same position • The player earns • Regular reward points + code reward points • If there is an adjacency, the player plays again after getting a new random digit CS 2204 Spring 2014
The Term Project, Ppm • If the random digit is played on a position directly • The largest digit played is 9 • If the random digit is added to a position display • The largest result is F • If the result exceeds F, there is a display overflow : the result is subtracted (16)10 • PD2 = A & RD = 9 A + 9 – (16)10 = 3 PD2 • The display blinks at a high rate CS 2204 Spring 2014
3 2 1 0 • The Term Project, Ppm • The code for each game • A 2-digit code • On the rightmost two displays • Both code digits are non-zero • The digits are invisible to the players • The digits can be discovered by observing reward points earned after each play CS 2204 Spring 2014
The Term Project, Ppm • After playing the random digit, the player earns two types of reward points • Total reward points = Regular reward points + code reward points • Regular reward points Based on the adjacency of the digit played • Code reward points • Playing one of the two code digits on display0or1 Code digits are always on displays 0 and 1 CS 2204 Spring 2014
The Term Project, Ppm • Regular reward points earned when digit K is played • If there is NOadjacency(0 adjacency) • Kregular reward points earned • Basic reward • If there is at least oneadjacency • (2 * K) reward points if there is oneadjacency • (4 * K) reward points if twoadjacencies • (8 * K) reward if threeadjacencies • The player playsagain, after getting a new random digit • The leftmost and rightmost displays are not adjacent ! CS 2204 Spring 2014
The Term Project, Ppm • Code reward points earned when digit K is played on position 0 or 1 • If the other position does not have the other code digit • Earn code reward points • (8 * K) reward points • If the other position has the other code digit • Earn code reward points • (Code) reward points • It is a 2-digit reward which can be up to FF = (255)10 CS 2204 Spring 2014
3 2 1 0 Regular reward points Code reward points • The Term Project, Ppm • Assume that • The displays are 7FE9 • The random digit is 5 • The code is 2E • If a player plays 5 on position 0 with an addition • The displays become 7FEE The other position does not have the other code digit • The player earns (2*E) + (8*E) = (2*14) + (8*14) = (140)10 points CS 2204 Spring 2014
3 2 1 0 Regular reward points Code reward points The player exceeds (255)10points and wins the game • The Term Project, Ppm • Assume that • The displays are 7FE9 • The random digit is 5 • The code is EE • If a player plays 5 on position 0 with an addition • The displays become 7FEE The other position has the other code digit • The player earns (2*E) + (EE) = (2*14) + (238) = 28 + 238 = (266)10 points The game is over ! CS 2204 Spring 2014
3 2 1 0 • The Term Project, Ppm • We will use the term adjacency, meaning the number of adjacencies • The adjacency ≡The number of adjacencies • The number of identical digits next to the digit played • The leftmost and rightmost displays are not adjacent ! 6 A 1 6 No adjacency ! CS 2204 Spring 2014
The Term Project, Ppm • Largest adjacencies do not mean largest regular rewards • Displays are 55AF and RD is 5, where and how do you play ? • A points oriented player plays on position 1 with and addition to earn (30)10 points as displays would have 55FF • There is one adjacency • The player plays again • Looking for largest adjacencies ? You would play on position 1 directly to earn (20)10 points as displays would have 555F • There are two adjacencies • The player plays again • The displays are kept small • But, if the code is Fx, one would play 55FF • The player plays again • The leftmost and rightmost displays are not adjacent ! CS 2204 Spring 2014
The Term Project, Ppm • Largest adjacencies do not mean largest regular rewards • Displays are 234A and RD is 4, where and how do you play ? • A points oriented player plays on position 0 with and addition to earn (14)10 points as displays would have 234E • Looking for largest adjacencies ? You would play on position 0 directly to earn (8)10 points as displays would have 2344 • There is one adjacency • The player plays again • If the code is 5E, • One would play with an addition to have 234E to earn (126)10 points There is no adjacency The player does not play again • If the code is 4E, • One would play with an addition to have 234E to earn (92)10 points There is no adjacency The player does not play again • The leftmost and rightmost displays are not adjacent ! CS 2204 Spring 2014
The Term Project, Ppm • Players can try to play so that • There are adjacenciesnow and in the near future • Adding the random digit to large digits result in display overflows and small rewards (earnings) unless there are adjacencies (of these small digits of course) • The code digits are tracked • The code digits are invisible and so discovering them requires continuous effort on both players • Thinking needed • Players must have strategies to play where and how to win games CS 2204 Spring 2014
The Term Project, Ppm • Having a strategy is not enough for all playing situations • The primary strategy cannot decide how to play sometimes • When there are equally playable positions • A secondary playing strategy is needed Displays : CAAC RD : 2 Primary strategy : Maximize regular reward points CCAC CACC Play on Position 2 with an addition ? Play on Position 1 with an addition ? Which position will be played on ? What is the code ? Not Cx ? CS 2204 Spring 2014