270 likes | 451 Views
Digital Design versus Computer Programming. IMPORTANCE OF PROJECTS IN THIS CLASS. How to learn and be successful. = Boo!. When I was young life of a student was really tough. >. I had to program in machine language. Machine language 01000010 01101111 01101111 00100001
E N D
Digital Design versus Computer Programming IMPORTANCE OF PROJECTS IN THIS CLASS How to learn and be successful
= Boo! When I was young life of a student was really tough >
I had to program in machine language Machine language • 01000010 01101111 01101111 00100001 • Specific to each machine, although often overlaps (e.g., all PCs read it the same way) • First coded on punch cards • I had to check each card that the holes were really punched – see the election problem. = Boo! BUT PROGRAMMING IN MACHINE LANGUAGE TEACHES YOU ABOUT REGISTERS AND COMPUTER ORGANIZATION >
Assembly language • Human-readable version of machine language, e.g. … • In programming terms: 10110000 01100001 • Again, not exactly inspiring dreams of teaching students = move al, 0x61 BUT assembly level programming teaches you about register transfers >
High-level languages • “high” = more abstract (removed) from machine language • More truly human-readable: IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. * ENVIRONMENT DIVISION. * DATA DIVISION. * PROCEDURE DIVISION. PARA-1. DISPLAY "Hello, world.". * EXIT PROGRAM. END PROGRAM HELLO-WORLD. • Use of compiler to generate machine code Programming in high level languages makes you more efficient and allows you to achieve the task faster but separates you from hardware >
Examples of early high-level languages: • ALGOL • APL • BASIC • COBOL • FORTRAN • Lisp • PL/I • RPG >
What is the best way to learn programming? Complaints: "The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence." - Edsger Dijkstra, “How Do We Tell Truths That Might Hurt?” >
#include <iostream> using namespace std; int main() { int num = 0; int numSquared = 0; cout << "I will square a number\n"; cout << "Please type a number to be squared: "; cin >> num; numSquared = num * num; cout << "\nThe square of this num is "; cout << numSquared; cout << "\n\nPlease hit any key to exit"; cin >> num; return 0; } public class SquareThis { public double SquareThis(int someNum) { int answer; answer = someNum * someNum; return answer; } } Side-by-side comparison > Java C++
(define (square-this some-number) (* some-number some-number) ) (square-this 3 5) to JB when [switch1] [ab, thatway setpower 4 onfor 40] when [switch2] [ab, thisway setpower 4 onfor 40] launch [loop [if switch3 [c, thisway on ] if not switch3 [c, thatway on ]]] end …by side comparison Scheme You should select a good language for your task > Yellow Brick Logo
History of the Comp Science programming • 1984 – 1998 = Pascal • 1999 – 2003 = C++ • 2004 - = Java “THE computer science language of the 1970s” ! You should select a good language to learn the concepts rather than syntax only. Java and Lisp are better than C++ >
And my advise is……. You should learn digital design by examples……. You should learn programming by examples……. You should build practical systems, never learn from book only …….
RobotC, Python and Robotics Scheme , Lisp and Robotics >
Verilog VHDL Programming in VHDL or Verilog is more like hardware design than software design. On the other hand you get experience with programming environment, compilers, editors etc. >
You should start programming and designing digital circuits when you are young, in a middle school or high school a debate between Einstein and Schroedinger Cat about quantum mechanics – an educational theatre.
Improvisational Theatre “What’s That? Schrödinger Cat” Schrödinger Cat Professor Einstein
2010 - OUR RECENT BIPED THEATRE New version of Hahoe To be shown in 2010 KHR-1 iSOBOT Lynxmotion Systems
Walking biped robot can express the fullness of human emotions: body gestures, dancing, jumping, gesticulating with hands. Emotions can be: Emergent - Arushi Programmed – Martin Lukac ISMVL Mimicked – ULSI Learned – Martin Lukac Reed-Muller Fighting KHR-1 robots
Marie Curie Emotional Robot Head You can work on these or other robots…..
Conclusions Practical project is an important component of this class It teaches very useful skills It teaches group work and design verification You cannot avoid using computers and programming when you are an engineer
What can you learn in 171 projects • Programming in Verilog or VHDL • Programming in Java, C++ or RobotC, related to hardware and robot design, in practical environment. • Building a digital circuit using FPGAs or PLDs. • Practically learning about interfacing and simple analog/digital circuits, motors, lights, etc. • Simulating digital circuits. • Designing conceptual digital systems, such as Sudoku Machine, or logic minimization machine.