Introduction to arcpy Debugging Using arcpy

comp541 digital logic and computer design n.w
1 / 58
Embed
Share

Application programming Python as an extension language for scripting software like Visual Basic for Applications (VBA) and Lua. Access ESRI applications through arcpy library, which simplifies drilling down into application objects. arcpy contains modules for geoprocessing, data access, mapping, spatial analysis, and network analysis. Python 2.7 used in ArcDesktop/ArcMap, while ArcGIS Pro uses Python 3.5. Differences between Python 2.7 and 3 highlighted.

  • Python
  • arcpy
  • debugging
  • application programming
  • ESRI

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. COMP541 Digital Logic and Computer Design Montek Singh Jan 10, 2018

  2. Todays Topics Course description What s this course about? Syllabus Textbook and Resources Course Requirements Grading Policies and Honor Code Material from Chapter 1 (self-study review) What is digital logic? Binary signaling Number systems Codes 2

  3. Whats This Course About? Digital Logic transistors (briefly) gates combinational circuits sequential circuits (state machines) Computer Design arithmetic circuits memories processor architecture input and output Emphasis on high-level descriptions hardware description lang (SystemVerilog) instead of circuits modern design practices 3

  4. Key Learning Objectives At the end of this course, you should be able to: convert a specification into an implementation hierarchically decompose a complex spec into simpler components understand concurrency develop concurrent system specs and implementations test a given design for correctness develop a test bench and performing simulation use state-of-the-art software tools for hardware design computer-aided-design (CAD) tools Each student will have: designed a full microprocessor (basic MIPS from COMP411) implemented it on a development kit programmed it in assembly to show a demo 4

  5. What do final projects look like? Full MIPS computer mini MIPS CPU memories output devices VGA display maybe sound input devices keyboard, maybe mouse joystick, accelerometer, keypad functioning demo examples (from Spring 2012) 5

  6. Who is this course for? Advanced course in digital logic and computer design follow-up to COMP 411 (Computer Organization) full-gate level implementation of MIPS processor from 411 including memories and I/O Who should take this course? undergrads who want to pursue a career or further studies in the fields of: computer architecture chip design, or other engineering disciples grad students looking to fill a gap in their coursework anyone interested in learning how a digital system is implemented, in a hands-on manner 6

  7. How will we build an entire computer? Labs on Fridays hands-on experience in designing digital circuits/systems start small, but quickly go to higher levels of abstraction We will write descriptions of design instead of drawing circuit diagrams descriptions look like code high-level language BEWARE: these are not software programs! use compilation tools to convert into gates and wires map ( burn ) these designs onto a reconfigurable chip called Field Programmable Gate Array (FPGAs) chips with a lot of circuits (millions of transistors) sort of like burning music to a rewritable CD 7

  8. Development Kits Each student will be loaned a kit for the semester BIG thanks to NVIDIA and Xilinx for donating $$ for our Nexys 4 kits!! In the middle: reconfigurable chip sort of a blank chip onto which you burn logic circuits first describe your design in a high-level language simulate design in software compile (synthesize) into gate-level circuit burn it onto this chip Dev kit (Nexys 4) 8

  9. How to represent circuits? Schematic Diagram: drawing showing components and their interconnections visual representation good for documentation good for small circuits infeasible for large-scale systems typically use hierarchical drawings 9

  10. How to represent circuits? Hardware Description Language (HDL): textual description of the circuit easier to type than to draw! works well with automated design and test tools we will use an HDL called Verilog /* A Mod 4 counter */ module CounterMod4 (clock, reset, value); input clock; input reset; output logic [1:0] value = 0; always_ff @(posedge clock) begin value <= reset ? 0 : (value + 1); end endmodule 10

  11. How to compile HDL to circuits? Use design tools from the kit maker Each student must install her/his own copy Download from web (link on course website) Big download: ~5 GB (allow several minutes/hours) Complete installation before Friday s lab session instructions on course website Platforms: Windows 7.1 and 10 Linux: Red Hat / SUSE / Cent / Ubuntu Mac OS X: use Bootcamp/VMWare/VirtualBox + Windows/Linux harder to make it work with Parallels only 64-bit architectures 11

  12. Grading Criteria Final grade will be based on: Labs: Final Project: 20% Homework: Quizzes: Midterm: Final Exam: 35% 55% 12% 8% 10% 15% 20% 25% Bonus Points: Up to 5 extra points may be awarded for extra credit work stellar work on lab assignments/project class participation participation on Piazza discussion board 12

  13. Grading Criteria Labs about one every week each builds upon the previous ones important to follow sequence, and DO THEM ALL culminates in the final project Project everyone builds a full microprocessor (basic MIPS from 411) write assembly code to show a demo ( game ) demo in front of whole class and other faculty and students may be invited Homework: 3-5 assignments Quizzes: 3-5 announced, ~20min long Exams: Midterm and Final 13

  14. Course Policies Late Penalty Labs: electronic submissions everyone gets 7 free late days for each calendar day (or part of day) late, one free day is spent once free days are exhausted, each late day results in 1 point taken out of the lab assignment score Homework: due in hardcopy in class/lab session one session late: 25% penalty two sessions late: 50% penalty after then, not accepted no late work accepted once solutions are distributed 14

  15. Course Policies Missed classes, quizzes, exam conflicts classes: while attendance is not required, there is no substitute to coming to class if you want a good grade labs: many assignments require demos during lab sessions I provide lots of tips/hints during the session skipping a lab (even if you have a good excuse) will make things very hard quizzes: since the dates are announced, please see me well in advance if you have a compelling reason for absence exams: bring any conflicts to my attention ASAP 15

  16. Honor Code Collaboration: Allowed (even encouraged) to discuss basic concepts use discussion board on Piazza bonus points for active participation! BUT: What you hand in must be your own write solutions and code individually Previous Semesters: Cannot use homework solutions from previous offerings of this course Cannot obtain lab assignments/code from students who have taken this course before Not following these rules is a violation of honor code 16

  17. Honor Code What happens if cheating/copying is suspected? reported to the Honor System if found guilty: severe penalty typically Failing grade on all or part of the course probation or suspension depending on severity cheating is not worth it we have smart TAs and sophisticated tools Spring 2017 (another class, not 541) reported 8 students to Honor System all either pleaded guilty or found guilty 17

  18. Textbook and Resources Textbook: be sure to get the 2nd ed. homework from this book Other resources: website homework, labs, lectures, etc. Verilog language reference on course website personal laptop computer Windows or Linux Mac OS with Bootcamp/VMWare/VirtualBox development kits (provided) Harris and Harris, Digital Design and Computer Architecture, 2nd ed. (July 2012), ISBN 9780123944245, Morgan Kaufmann 18

  19. Overview of Textbook Chapters 1-5: Digital logic Combinational, sequential, basic circuits, HDL Chapter 6: Architecture Fast review for those who took COMP 411 Chapter 7: Microarchitectures Chapters 8: Memories Appendix A: Implementation FPGAs, etc. Order of topics: Will change order from that in book to try to get you working on interesting labs sooner 19

  20. Class Web Page Website: http://comp541spring18.web.unc.edu Linked from my home page http://www.cs.unc.edu/~montek All lecture slides, lab assignments posted there Syllabus, homework, etc. posted there See Sakai for scores/grades Use Piazza for questions/discussions LAs: Jack Perisich and Dylan Tastet Office Hours to be finalized by end of today 20

  21. Now Shift to Technology Should be a review for all of you

  22. Complexity and Abstraction This course will span several abstraction levels from transistors to architecture Mostly stay above transistor level at most one class on transistors and chip layout Mostly go bottom up culminate in the design of a full computer in the labs 22

  23. The Three -Ys Hierarchy divide a system into modules and submodules keep dividing until pieces are easy to understand Modularity modules have well-defined functions and interfaces so can be connected easily without surprises Regularity encouraging uniformity, so modules can be easily reused so same set of basic building blocks can be used e.g., a 16-bit adder uses the same basic blocks as an 8-bit adder 23

  24. Digital vs. Analog Analog infinite resolution Like (old fashioned) radio dial We ll do very little with analog VGA, maybe sound: approximate them using digital values Digital a finite set of values Like money Can t get smaller than cents Typically also has maximum value 24

  25. Binary Signaling Zero volts FALSE or 0 5 or 3.3 (or 1.8 or 1.5) volts TRUE or 1 Modern chips down to 1V Why not multilevel signaling? 25

  26. Discrete Data Some data inherently discrete Names (sets of letters) Some quantized Music recorded from microphone Note that other examples like music from CD or electronic keyboard already quantized Mouse movement is quantized 26

  27. Numbers and Arithmetic I have put most of these slides at end Backup in case you ve forgotten Review of: binary/octal/hexadecimal numbers arithmetic Let s cover Other codes, parity 27

  28. BCD Binary Coded Decimal Decimal digits stored in binary Four bits/digit Like hex, except stops at 9 Example 931 is coded as 1001 0011 0001 Remember: these are just encodings. Meanings are assigned by us. 28

  29. Other Codes Exist Non positional Example: Gray Code Only one bit changes at a time 000,001,011,010,110,111,101,100 Why is this useful? Actually there s a family of Gray codes Ref: http://lib-www.lanl.gov/numerical/bookcpdf/c20-2.pdf 29

  30. Example: Rotary/shaft encoder Why is Gray coding better here? (From Wikipedia) 30

  31. Character Codes From numbers to letters ASCII Stands for American Standard Code for Information Interchange Only 7 bits defined Unicode You may make up your own code for the MIPS VGA 31

  32. ASCII table 32

  33. Even Parity Sometimes an extra bit (parity bit) appended to enable detection of errors Even parity set parity bit to make number of 1 s even Examples: assume the parity bit is added to the left A (1000001) for an even-parity system is 01000001 C (1000011) for an even-parity system is 11000011 33

  34. Odd Parity Similar except make the number of 1 s odd Examples A (1000001) for an odd-parity system is 11000001 C (1000011) for an odd-parity system is 01000011 34

  35. Error Detection Note that parity detects only simple errors One, three, etc. bits More complex methods exist Some that enable recovery of original info Cost is more redundant bits 35

  36. Reading Read Chapter 1 36

  37. Next Class Combinational Logic Basics First Lab: Fri, Jan 12 You should have your tools installed and bring your laptop We will explain the lab and answer any questions 37

  38. Reference Slides Should be all review material

  39. Binary Numbers Strings of binary digits ( bits ) One bit can store a number from 0 to 1 n bits can store numbers from 0 to 2n 39

  40. Binary Powers of 2 Positional representation Each digit represents a power of 2 So 101 binary is 1 22 + 0 21 + 1 20 or 1 4 + 0 2 + 1 1 = 5 40

  41. Converting Binary to Decimal Easy, just multiply digit by power of 2 Just like a decimal number is represented Example follows 41

  42. Binary Decimal Example 7 6 5 4 3 2 1 0 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 What is 10011100 in decimal? 1 0 0 1 1 1 0 0 128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156 42

  43. Decimal to Binary A little more work than binary to decimal Some examples 3 = 2 + 1 = 11 (that s 1 21 + 1 20) 5 = 4 + 1 = 101 (that s 1 22 + 0 21 + 1 20) 43

  44. Algorithm Decimal to Binary Find largest power-of-two smaller than decimal number Make the appropriate binary digit a 1 Subtract the power of 2 from decimal Do the same thing again 44

  45. Decimal Binary Example Convert 28 decimal to binary 32 is too large, so use 16 Binary 10000 Next is 8 Decimal 28 16 = 12 Binary 11000 Next is 4 Decimal 12 8 = 4 Binary 11100 Decimal 4 4 = 0 7 6 5 4 3 2 1 0 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 45

  46. Hexadecimal Strings of 0s and 1s too hard to write Use base-16 or hexadecimal 4 bits Dec 0 1 2 3 4 5 6 7 Bin 0000 0001 0010 0011 0100 0101 0110 0111 Hex 0 1 2 3 4 5 6 7 Dec 8 9 10 11 12 13 14 15 Bin 1000 1001 1010 1011 1100 1101 1110 1111 Hex 8 9 ? ? ? ? ? ? 46

  47. Hexadecimal Letters to represent 10-15 Dec 0 1 2 3 4 5 6 7 Bin 0000 0001 0010 0011 0100 0101 0110 0111 Hex 0 1 2 3 4 5 6 7 Dec 8 9 10 11 12 13 14 15 Bin 1000 1001 1010 1011 1100 1101 1110 1111 Hex 8 9 a b c d e f Why use base 16? Power of 2 Size of byte 47

  48. Hex to Binary Bin Hex 0000 0 0001 1 0010 2 Convention write 0x before number Hex to Binary just convert digits 0011 3 0100 4 0101 5 0110 6 0x2ac 0111 7 1000 8 1001 9 0010 0x2ac = 001010101100 1010 1100 1010 a 1011 b 1100 c 1101 d No magic remember 1 hexit = 4 bits 1110 e 1111 f 48

  49. Binary to Hex Bin 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Hex 0 1 2 3 4 5 6 7 8 9 a b c d e f Just convert groups of 4 bits (group from LSB) 101 0011 0111 1011 0101 0011 0111 1011 5 3 7 b 101001101111011 = 0x537b 49

  50. Hex to Decimal Dec 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hex 0 1 2 3 4 5 6 7 8 9 a b c d e f Just multiply each hex digit by decimal value, and add the results. 0x2ac 2 256 + 10 16 + 12 1 = 684 3 2 1 0 position 163 4096 162 256 161 16 160 1 power value 50

More Related Content