Digital Design through Arduino

Similar documents
Digital Design through Pi

Assembly Programming through Arduino

Sample Test Paper - I

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

Exam for Physics 4051, October 31, 2008

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

Digital Electronics Final Examination. Part A

EXPERIMENT Bit Binary Sequential Multiplier

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

CHW 261: Logic Design

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Digital Circuits ECS 371

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Digital Electronics Circuits 2017

Digital Electronic Meters

CHAPTER 7. Exercises 17/ / /2 2 0

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

A B D 1 Y D 2 D 3. Truth table for 4 to 1 MUX: A B Y 0 0 D D D D 3

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Digital Signal 2 N Most Significant Bit (MSB) Least. Bit (LSB)

04. What is the Mod number of the counter circuit shown below? Assume initially reset.

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Experiment 9 Sequential Circuits

CSE 140L Spring 2010 Lab 1 Assignment Due beginning of the class on 14 th April

Digital Electronics. Part A

ECE 341. Lecture # 3

DE58/DC58 LOGIC DESIGN DEC 2014

Design of Combinational Logic

Design of Sequential Circuits

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Signals and Systems Digital Logic System

Chapter 4. Sequential Logic Circuits

Random Number Generator Digital Design - Demo

Digital Logic Appendix A

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Shift Register Counters

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

Design at the Register Transfer Level

Analog & Digital Electronics Laboratory. Code - CS391. Lab Manual

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Digital Circuits, Binary Numbering, and Logic Gates Cornerstone Electronics Technology and Robotics II

ECE20B Final Exam, 200 Point Exam Closed Book, Closed Notes, Calculators Not Allowed June 12th, Name

Boolean Logic Prof. James L. Frankel Harvard University. Version of 3:20 PM 29-Aug-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved.

Sequential Logic Circuits


Layout of 7400-series Chips Commonly Used in. CDA 3101: Introduction to Computer Hardware and Organization

Digital Fundamentals

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?


Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Chapter 5 Synchronous Sequential Logic

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Boolean Logic Continued Prof. James L. Frankel Harvard University

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package. *MR for LS160A and LS161A *SR for LS162A and LS163A

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Philadelphia University Student Name: Student Number:

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

5 8 LED MAX6950/MAX6951 MAX6950/MAX6951 SPI TM QSPI TM MICROWIRE TM 7 LED LED 2.7V MAX LED MAX LED 16 (0-9 A-F) RAM 16 7 LED LED

DIGITAL LOGIC DESIGN

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Hardware testing and design for testability. EE 3610 Digital Systems

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

ENGR-4300 Fall 2008 Test 3. Name SOLUTION. Section 1(MR 8:00) 2(TF 2:00) (circle one) Question I (20 points) Question II (15 points)

RAO PAHALD SINGH GROUP OF INSTITUTIONS BALANA(MOHINDER GARH)123029

Vidyalankar S.E. Sem. III [EXTC] Digital Electronics Prelim Question Paper Solution ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD = B

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Fundamentals of Boolean Algebra

Computer Science Final Examination Friday December 14 th 2001

Philadelphia University Student Name: Student Number:

Lecture 8: Sequential Networks and Finite State Machines

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Advanced Boolean Logic and Applications to Control Systems

University of Florida EEL 3701 Fall 2014 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Wednesday, 15 October 2014

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Number System conversions

CPE100: Digital Logic Design I

NTE74176 Integrated Circuit TTL 35Mhz Presettable Decade Counter/Latch

Pin Details of Digital Logic Gates:

Preparation of Examination Questions and Exercises: Solutions

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

Lecture 17: Designing Sequential Systems Using Flip Flops

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

CSCI 2150 Intro to State Machines

Transcription:

1 Digital Design through Arduino G V V Sharma Contents 1 Display Control through Hardware 1 1.1 Components......... 1 1.2 Powering the Display.... 1 1.3 Controlling the Display... 2 2 Display Control through Arduino Software 3 2.1 Driving the Segments.... 3 2.2 Counting Decoder...... 3 2.3 Display Decoder....... 4 Component Value Quantity Breadboard 1 Resistor 220Ω 1 Arduino Uno 1 Seven Segment Common 1 Display Anode Decoder 7447 1 Flip Flop 7474 2 Jumper Wires 20 TABLE 1.0 3 Decade Counter through Arduino 4 3.1 Decade Counter through Flip Flops............. 4 Abstract This manual covers the entire breadth of digital design by building a decade counter using an arduino. In the process, boolean logic, combinational logic and sequential logic are covered. Fig. 1.1 1 Display Control through Hardware 1.1 Components The components required for this manual are listed in Table 1.0 1.2 Powering the Display The breadboard can be divided into 5 segments. In each of the green segements, the pins are internally connected so as to have the same voltage. Similarly, in the central segments, the pins in each column are internally connected in the same fashion as the blue columns. Problem 1.1. Plug the display to the breadboard in Fig. 1.1 The seven segment display in Fig. 1.2 has eight pins, a, b, c, d, e, f, g and dot that take an active LOW input, i.e. the LED will glow only if the input is connected to ground. Each of these pins is connected to an LED segment. The dot pin is reserved for the LED. Problem 1.2. Connect one end of the resistor to the COM pin of the display and the other end to an extreme pin of the breadboard. The Arduino Uno has some ground pins, analog input pins A0-A3 and digital pins D1-D13 that can be used for both input as well as output. It also *The author is with the Department of Electrical Engineering, Indian Institute of Technology, Hyderabad 502285 India e-mail: gadepall@iith.ac.in. All content in this manual is released under GNU GPL. Free and open source.

2 g f COM a b a a b c d e f g decimal 1 0 0 1 1 1 1 1 0 0 1 0 0 1 0 2 TABLE 1.9 f b a=0 g b=0 b=0 e c g=0 d dot c=0 e=0 d=0 Fig. 1.9 e d COM c dot Fig. 1.2 has two power pins that can generate 3.3V and 5V. In the following exercises, only the GND, 5V and digital pins will be used. Problem 1.3. Connect the 5V pin of the arduino to an extreme pin that is in the same segment as the 1K resistor pin. Problem 1.4. Connect the GND pin of the arduino to the opposite extreme pin of the breadboard Problem 1.5. Connect the Arduino to the computer. Problem 1.6. Connect the dot pin of the display to a pin in the same segment as the GND pin. What do you observe? Problem 1.10. Now generate all numbers between 0-9 on the display using the above table. The 7447 IC helps in displaying decimal numbers on the seven segment display. The ā ḡ, pins of the 7447 IC are connected to the a g pins of the display. V cc should be connected to a 5V power source. The input pins of the decoder are A,B,C and D, with A being the lowest significant bit (LSB) and D being the most significant bit (MSB). For example, the number 5 is visible on the display when the A,B,C and D inputs are the following. V CC 16 f 15 D C B A Decimal 0 1 0 1 5 ḡ 14 ā 13 b 12 c 11 d 10 ē 9 1.3 Controlling the Display Fig. 1.9 explains how to get decimal digits using the seven segment display. Problem 1.7. Generate the number 1 on the display by connecting only the pins b and c to GND. Problem 1.8. Repeat the above exercise to generate the number 2 on the display. Problem 1.9. Table 1.9 summarizes the process of generating the decimal digits. 0 means connecting to ground and 1 means not connecting. Complete Table 1.9 for all numbers between 0-9. 7447 1 2 3 4 5 6 7 8 B C D A GND Fig. 1.10 Problem 1.11. Connect the 7447 IC decoder ā ḡ pins to the a g pins of the display respectively. Problem 1.12. Connect the V cc and GND pins of the decoder to the 5V supply and GND pins of the

3 breadboard. Problem 1.13. Connect the A,B,C,D pins to pins in the GND extreme segment of the breadboard. What do you observe. Problem 1.14. Now remove the D pin from the breadboard and observe the display output. Problem 1.15. Generate a table with A,B,C,D inputs and the equivalent decimal number output. 2 Display Control through Arduino Software 2.1 Driving the Segments Open the arduino software. Check if the ports show Arduino Uno and click the appropriate button. Problem 2.1. Connect the A-D pins of the 7447 IC to the pins D2-D5 of the Arduino. Problem 2.2. Type the following code and execute. What do you observe? // Remove t h e f o l l o w i n g two l i n e s i f you are u s i n g t h e Arduino IDE # i n c l u d e Arduino. h // d e c l a r i n g o u t p u t p i n s pinmode ( 2, OUTPUT) ; pinmode ( 3, OUTPUT) ; pinmode ( 4, OUTPUT) ; pinmode ( 5, OUTPUT) ; // W r i t i n g data t o t h e o u t p u t p i n s d i g i t a l W r i t e ( 2, 1) ; // LSB d i g i t a l W r i t e ( 3, 0) ; d i g i t a l W r i t e ( 4, 1) ; d i g i t a l W r i t e ( 5, 0) ; // MSB Problem 2.3. Now generate the numbers 0-9 by modifying the above program. 2.2 Counting Decoder In the truth table in Table 2.6, W, X, Y, Z are the inputs and A, B, C, D are the outputs. This table represents the system that increments the numbers 0-8 by 1 and resets the number 9 to 0 Note that D=1for the inputs 0111 and 1000. Using boolean logic, D=WXYZ + W X Y Z (2.3.1) Note that 0111 results in the expression WXYZ and 1000 yields W X Y Z. Problem 2.4. Write a program for implementing functions like (2.3.1) in Arduino for B,C and D. Solution: // Remove t h e f o l l o w i n g l i n e i f you are u s i n g t h e Arduino IDE # i n c l u d e Arduino. h // D e c l a r i n g a l l v a r i a b l e s as i n t e g e r s i n t Z=0,Y=1,X=1,W=1; i n t D, C, B,A; // d e c l a r i n g o u t p u t p i n s pinmode ( 2, OUTPUT) ; pinmode ( 3, OUTPUT) ; pinmode ( 4, OUTPUT) ; pinmode ( 5, OUTPUT) ; A=0; B=(W&&!X&&!Y&&!Z ) (!W&&X&&!Y &&!Z ) (W&&!X&&Y&&!Z ) (!W &&X&&Y&&!Z) ;

4 Z Y X W D C B A 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0 TABLE 2.6 C=(W&&X&&!Y&&!Z ) (!W&&!X&&Y &&!Z ) (W&&!X&&Y&&!Z ) (!W &&X&&Y&&!Z ) ; D = (W&&X&&Y&&!Z) (!W&&!X&&!Y&& Z ) ; // W r i t i n g data t o t h e o u t p u t p i n s d i g i t a l W r i t e ( 2, A) ; // LSB d i g i t a l W r i t e ( 3, B) ; d i g i t a l W r i t e ( 4, C) ; d i g i t a l W r i t e ( 5, D) ; // MSB //&& i s t h e AND o p e r a t i o n // i s t h e OR o p e r a t i o n //! i s t h e NOT o p e r a t i o n Problem 2.5. Modify the above program by changing W,X,Y,Z and A and execute. Verify that your results are consistent with Table 2.6. Problem 2.6. Write the boolean logic function for A in terms of W, X, Y, Z. Problem 2.7. Verify if your logic is correct by observing the output on the seven segment display. 2.3 Display Decoder Problem 2.8. Now write the truth table for the seven segment display decoder (IC 7447). The inputs will be A, B, C, D and the outputs will be a, b, c, d, e, f, g. Problem 2.9. Obtain the logic functions for outputs a, b, c, d, e, f, g in terms of the inputs A, B, C, D. Problem 2.10. Disconnect the arduino from IC 7447 and connect the pins D2-D8 in the Arduino directly to the seven segment display. Problem 2.11. Write a new program to implement the logic in Problem 2.9 and observe the output in the display. You have designed the logic for IC 7447! Problem 2.12. Now include your counting decoder program in the display decoder program and see if the display shows the consecutive number. A decade counter counts the numbers from 0-9 and then resets to 0. Problem 2.13. Suitably modify the above program to obtain a decade counter. 3 Decade Counter through Arduino 3.1 Decade Counter through Flip Flops Open the blink program. You will see the following // Remove t h e f o l l o w i n g l i n e i f you are u s i n g t h e Arduino IDE # i n c l u d e Arduino. h // i n i t i a l i z e d i g i t a l p i n 13 as an o u t p u t. pinmode ( 1 3, OUTPUT) ; // t u r n t h e LED on (HIGH i s t h e v o l t a g e l e v e l ) d i g i t a l W r i t e ( 1 3, 1) ; // w a i t f o r a second d e l a y ( 1 0 0 0 ) ; // t u r n t h e LED o f f by making t h e v o l t a g e LOW d i g i t a l W r i t e ( 1 3, 0) ; // w a i t f o r a second

5 d e l a y ( 1 0 0 0 ) ; Problem 3.1. Connect the digital pin 13 of the arduino to the dot pin of the display. Execute the Blink program. Problem 3.2. Change the delay to 500 ms in the program and execute. What do you observe? The 7474 IC in Fig. 3.2 has two D flip flops. The D pins denote the input and the Q pins denote the output. CLK denotes the clock input. V CC 14 13 D2 12 CLK2 11 10 Q2 9 8 7474 1 2 3 4 5 6 7 D1 CLK1 Q1 GND Fig. 3.2 Problem 3.3. Connect the D2-D5 pins of the arduino to the Q pins of the two 7474 ICs. Use the D2-D5 pins as Arduino input. Problem 3.4. Connect the Q pins to IC 7447 Decoder as input pins. Connect the 7447 IC to the seven segment display. Problem 3.5. Connect the D6-D9 pins of the arduino to the D input pins of two 7474 ICs. Use the D6-D9 pins as Arduino output. Problem 3.6. Connect pin 13 of the Arduino to the CLK inputs of both the 7474 ICs. Problem 3.7. Connect pins 1, 4, 10 and 13 of both 7474 ICs to 5V. Problem 3.8. Using the logic for the counting decoder in the Ardunio software, implement the decade counter.