This presentation encapsulates the briefings of the lectures taken on the unit2 of Logic Development and Programming (EC221) taught in Integral University
In this slide we have discussed, different arithmetic operations like addition, subtraction, multiplication and division for binary numbers. Addition and subtraction operation is achieved using one's complement and two's complement number system.
This presentation deals with the lecture notes of unit 4 of the course Basic Electronics EC101 which is a common course of B.Tech Curriculum having 4 credits.
See The videos in YouTube, if you want to receive all videos please Subscribe to the channel.
Bit-pair recoded multiplication algorithm - Modified Booth’s algorithm (PPT2) https://youtu.be/thC8B4B-PyY
4 Non-Restoring Division Flow chart (PPT2) https://youtu.be/m7JtcP5QmFA
5. Non-Restoring Division Example 1. 10/3: (PPT2) https://youtu.be/NbfTKSm4ubM
6. Non-Restoring Division Example 2. -12/3: (PPT2) https://youtu.be/RhiBtztCESI
ENGR 232
Dynamic Engineering
Systems
Lecture 1.2 - Appendix
Introduction to Numerical
Solution
s
with Differential Equations
Dr. Michael Ryan
Runge-Kutta Methods
• Euler uses information from the current pair (tn, yn) to determine value at the next
pair (tn+1, yn+1)
• Runge-Kutta (2nd and 4th order methods) use a look ahead to get the slopes at
strategically chosen nearby points which are weighted to maximize the accuracy of
the approximation.
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 201/06/2016
Second-order Runge-Kutta
(aka midpoint method)
• Use slope at (tn, yn) to look a half-step ahead to the point
• Compute slope at this midpoint and use this slope to move from (tn, yn)
to (tn+1, yn+1)
• The algorithm follows
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 3
𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏+
𝒉
𝟐
𝒇(𝒕𝒏, 𝒚𝒏)
01/06/2016
Second-order Runge-Kutta
(aka midpoint method)
Given the IVP 𝑦′ = 𝑓 𝑡, 𝑦 𝑦 𝑡0 = 𝑦0
And a step size of h
To go from 𝑡𝑛,𝑦𝑛 𝑡𝑜 𝑡𝑛+1, 𝑦𝑛+1 𝑢𝑠𝑒:
where
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 4
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒌𝒏𝟐
01/06/2016
Numerical Example
Consider Euler h = 0.5 step from t = 0.0 to 0.5
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 5
t y Euler dydt y analytic error
0 1 -1 1.000 0.000
0.5 0.5 0 0.713 0.213
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏 = 𝐟 𝟎, 𝟏 = (𝐭 − 𝐲) = −𝟏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉 = 𝟎. 𝟓
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒌𝒏𝟐 = 𝟏 − 𝟎. 𝟐𝟓 = 𝟎. 𝟕𝟓
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏 = 𝒇 𝟎. 𝟐𝟓,𝟎. 𝟕𝟓 = −𝟎.𝟓
Using Runge-Kutta
at t = 0.5, y = 0.75
Compare to Euler;
RK error is -0.037
01/06/2016
Forth-order Runge-Kutta
Given the IVP 𝑦′ = 𝑓 𝑡, 𝑦 𝑦 𝑡0 = 𝑦0
And a step size of h; to go from 𝑡𝑛, 𝑦𝑛 𝑡𝑜 𝑡𝑛+1, 𝑦𝑛+1 :
First computing
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 6
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉
𝒚𝒏+𝟏 = 𝒚𝒏 +
𝒉
𝟔
𝒌𝒏𝟏 + 𝟐𝒌𝒏𝟐 + 𝟐𝒌𝒏𝟑 + 𝒌𝒏𝟒
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏
𝒌𝒏𝟑 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟐 𝒌𝒏𝟒 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 + 𝒉𝒌𝒏𝟑
01/06/2016
Error Comparison
Method One step result Actual Error
Exact y(1) = 0.1487…
Euler y(1) = 0 0.1487…
2nd
Runge-Kutta
y(1) = 0.125 0.0237…
4th
Runge-Kutta
y(1) = 0.15 0.0013…
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 7
...
In this slide we have discussed, different arithmetic operations like addition, subtraction, multiplication and division for binary numbers. Addition and subtraction operation is achieved using one's complement and two's complement number system.
This presentation deals with the lecture notes of unit 4 of the course Basic Electronics EC101 which is a common course of B.Tech Curriculum having 4 credits.
See The videos in YouTube, if you want to receive all videos please Subscribe to the channel.
Bit-pair recoded multiplication algorithm - Modified Booth’s algorithm (PPT2) https://youtu.be/thC8B4B-PyY
4 Non-Restoring Division Flow chart (PPT2) https://youtu.be/m7JtcP5QmFA
5. Non-Restoring Division Example 1. 10/3: (PPT2) https://youtu.be/NbfTKSm4ubM
6. Non-Restoring Division Example 2. -12/3: (PPT2) https://youtu.be/RhiBtztCESI
ENGR 232
Dynamic Engineering
Systems
Lecture 1.2 - Appendix
Introduction to Numerical
Solution
s
with Differential Equations
Dr. Michael Ryan
Runge-Kutta Methods
• Euler uses information from the current pair (tn, yn) to determine value at the next
pair (tn+1, yn+1)
• Runge-Kutta (2nd and 4th order methods) use a look ahead to get the slopes at
strategically chosen nearby points which are weighted to maximize the accuracy of
the approximation.
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 201/06/2016
Second-order Runge-Kutta
(aka midpoint method)
• Use slope at (tn, yn) to look a half-step ahead to the point
• Compute slope at this midpoint and use this slope to move from (tn, yn)
to (tn+1, yn+1)
• The algorithm follows
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 3
𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏+
𝒉
𝟐
𝒇(𝒕𝒏, 𝒚𝒏)
01/06/2016
Second-order Runge-Kutta
(aka midpoint method)
Given the IVP 𝑦′ = 𝑓 𝑡, 𝑦 𝑦 𝑡0 = 𝑦0
And a step size of h
To go from 𝑡𝑛,𝑦𝑛 𝑡𝑜 𝑡𝑛+1, 𝑦𝑛+1 𝑢𝑠𝑒:
where
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 4
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒌𝒏𝟐
01/06/2016
Numerical Example
Consider Euler h = 0.5 step from t = 0.0 to 0.5
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 5
t y Euler dydt y analytic error
0 1 -1 1.000 0.000
0.5 0.5 0 0.713 0.213
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏 = 𝐟 𝟎, 𝟏 = (𝐭 − 𝐲) = −𝟏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉 = 𝟎. 𝟓
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒌𝒏𝟐 = 𝟏 − 𝟎. 𝟐𝟓 = 𝟎. 𝟕𝟓
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏 = 𝒇 𝟎. 𝟐𝟓,𝟎. 𝟕𝟓 = −𝟎.𝟓
Using Runge-Kutta
at t = 0.5, y = 0.75
Compare to Euler;
RK error is -0.037
01/06/2016
Forth-order Runge-Kutta
Given the IVP 𝑦′ = 𝑓 𝑡, 𝑦 𝑦 𝑡0 = 𝑦0
And a step size of h; to go from 𝑡𝑛, 𝑦𝑛 𝑡𝑜 𝑡𝑛+1, 𝑦𝑛+1 :
First computing
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 6
𝒌𝒏𝟏 = 𝒇 𝒕𝒏, 𝒚𝒏
𝒕𝒏+𝟏 = 𝒕𝒏 + 𝒉
𝒚𝒏+𝟏 = 𝒚𝒏 +
𝒉
𝟔
𝒌𝒏𝟏 + 𝟐𝒌𝒏𝟐 + 𝟐𝒌𝒏𝟑 + 𝒌𝒏𝟒
𝒌𝒏𝟐 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟏
𝒌𝒏𝟑 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 +
𝒉
𝟐
𝒌𝒏𝟐 𝒌𝒏𝟒 = 𝒇 𝒕𝒏 +
𝒉
𝟐
, 𝒚𝒏 + 𝒉𝒌𝒏𝟑
01/06/2016
Error Comparison
Method One step result Actual Error
Exact y(1) = 0.1487…
Euler y(1) = 0 0.1487…
2nd
Runge-Kutta
y(1) = 0.125 0.0237…
4th
Runge-Kutta
y(1) = 0.15 0.0013…
ENGR 232 Winter 16 Lecture 1.2 – Dr. M. Ryan 7
...
Unit 1 Introduction to Non-Conventional Energy ResourcesDr Piyush Charan
This unit is part of the course EC228 Renewable Energy Engineering of program B.Tech. Electronics Engg. (Solar Photovoltaic Engineering). It gives an introduction to conventional and non-conventional energy resources.
Unit 5-Operational Amplifiers and Electronic Measurement DevicesDr Piyush Charan
Lecture Notes on Operational Amplifiers and Measuring Instruments. These notes cover unit 5 of the course Basic Electronics (EC101) taught at Integral University.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Immunizing Image Classifiers Against Localized Adversary Attacks
Unit 2: Data Representation contd.
1. Lectures on Complement Theory (1’s and 2’s, 9’s
and 10’s), BCD Addition, Decimal, Octal, and
Hexadecimal Addition
for
Open Educational Resource
on
Logic Development and Programming (EC221)
by
Dr. Piyush Charan
Assistant Professor
Department of Electronics and Communication Engg.
Integral University, Lucknow
2. 2
1. Complement Theory
2. 1’s and, 2’s complement operation
Number System Continued....
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
3. 3
1.Complement Theory
Example 1 Get 1’s complement of 50
Complement Digits
50 = 110010
001101
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
4. 4
1’s Complement Arithmetic
(ADD/SUB Method)
1. Read both the operands
2. Negative operand(s) (if any) is converted into 1’s complement form
3. Add both the numbers
4. If carry is generated (i.e. =1) then the resultant number is positive.
5. Add ONE to the output of setp4, to get the final answer.
6. If carry is not generated then the answer is Negative and available in 1’s complement form.
7. Convert output of step 6 into 1’s complement to get final answer.
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
5. 5
1. 1’s Complement Theory
Example 1 : Subtract 1010 from 1111 using 1’s complement theory. (15-10 Small negative)
1 0 1 0 0 1 0 1
1 1 1 1
0 1 0 1+
1] 0 1 0 0
+ 0 0 0 1
0 1 0 1 =(5)
1’s complement
Carry “1” means the answer is positive .
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
6. 6
1. 1’s Complement Theory
Example 2 : Subtract 1010 from 1000 using 1’s complement theory. (Large negative 8-10)
1 0 1 0 0 1 0 1
1 0 0 0
0 1 0 1+
0] 1 1 0 1
1’s complement
Carry “0” means the answer is negative and available in 1’s complement form.
1 1 0 1 0 0 1 0 = (2)
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
7. 7
2’s Complement Arithmetic
1. How to get 2’s complement form
2. Arithmetic operation using 2’s complement theory
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
8. 8
2’s Complement Arithmetic (How to get 2’s
complement form..?)
Example 1
Example 2
Complement Digits
Add 1
5 = 00000101
-5 = 11111011
11111010
+1
Complement Digits
Add 1
-13 = 11110011
13 = 00001101
00001100
+1
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
9. 9
2’s Complement Arithmetic
(Method)
1. Read both the operands
2. Negative operand (if any) is converted into 2’s complement form
3. Add both the numbers (2’s complement of negative operand with the other one).
4. If carry is generated (i.e. =1) then the resultant number is positive and in original form
5. If carry is not generated(when we have negative operand) then the carry is assumed =0.
6. Carry zero means the resultant number is negative and in a 2’s complement form.
7. Convert the 2’s complement form into the original form.
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
10. POS + NEG → POS Answer
10
Take the 2’s complement of the negative number and use regular binary 8-bit
addition.
000010019
+ (-5)
4
⎯→
⎯
11111011+
00000101
11111010
+1
11111011
2’s
Complement
Process
100000100
Last Bit = 1: Answer is Positive Disregard 9th
Bit
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
11. POS + NEG → NEG Answer
11
Take the 2’s complement of the negative number and use regular 8-bit
binary addition.
11110111(-9)
+ 5
-4
⎯→
⎯
00000101+
00001001
11110110
+1
11110111
2’s
Complement
Process
011111100
Last Bit = 0: Answer is Negative . Discard the last bit
11111100
00000011
+1
00000100
To Check:
Perform 2’s
Complement
On Answer
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
12. Verify the logic using following combinations:
1: (10) –(01)
2: (10) –(02)
3: (10) –(05)
4: (10) –(08)
5: (10) –(09)
6: (10) –(10)
7: (210) –(08)
8: (120) –(55)
9: (52) –(18)
01-10-2020 12Dr. Piyush Charan, Dept. of ECE, IU Lucknow
13. A+B A B 2’s of B Addition Ans
A=10
B=-1
1 0 1 0
0 0 0 1 1 1 1 0
0 0 0 1
1 1 1 1
1 0 1 0
1 1 1 1 CY =1 So ans is +ve
1 1 0 0 1
+9
B=-2 0 0 1 0 1 1 0 1
0 0 0 1
1 1 1 0
1 0 1 0
1 1 1 0 CY =1 So ans is +ve
1 1 0 0 0
+8
B=-5 0 1 0 1 1 0 1 0
0 0 0 1
1 0 1 1
1 0 1 0
1 0 1 1
1 0 1 0 1 CY =1 So ans is +ve
+5
B=-8 1 0 0 0 0 1 1 1
0 0 0 1
1 0 0 0
1 0 1 0
1 0 0 0
1 0 0 1 0 CY =1 So ans is +ve
+2
B=-9 1 0 0 1 0 1 1 0
0 0 0 1
0 1 1 1
1 0 1 0
0 1 1 1
1 0 0 0 1 CY =1 So ans is +ve
+1
B=-10 1 0 1 0 0 1 0 1
0 0 0 1
0 1 1 0
1 0 1 0
0 1 1 0
1 0 0 0 0 CY =1 So ans is +ve
+0
2’s Complement Arithmetic (Examples)
01-10-2020
13Dr. Piyush Charan, Dept. of ECE, IU Lucknow
14. Example: Perform 2’s complement subtraction on 210-08
210 = 1 1 0 1 0 0 1 0 (Subtrahend)
8= 0 0 0 0 1 0 0 0 (Minuend)
2’s complement of 8 is = 1 1 1 1 1 0 0 0
Add both the numbers:
1 1 0 1 0 0 1 0
+1 1 1 1 1 0 0 0
1 1 1 0 0 1 0 1 0
Carry = 1 means and is positive +202
01-10-2020 14Dr. Piyush Charan, Dept. of ECE, IU Lucknow
15. 15
2’s Complement Arithmetic (Examples on varying
number of bits)
Example: Perform 2’s complement arithmetic for (30)-(50) using
1: 6-bit number system
2: 8-bit number system
01-10-2020 Dr. Piyush Charan, Dept. of ECE, IU Lucknow
16. Example: Perform 2’s complement arithmetic for (30)-(50) using:
(30)= 0 1 1 1 1 0
(-50)= 1 1 0 0 1 0 2’s complement 0 0 1 1 0 1
0 0 0 0 0 1
0 0 1 1 1 0
Add both the numbers
0 1 1 1 1 0
0 0 1 1 1 0
0 1 0 1 1 0 0
Carry =0 means number is negative and in 2’s compl form
(30)= 0 0 0 1 1 1 1 0
(-50)= 0 0 1 1 0 0 1 0 2’s complement 1 1 0 0 1 1 0 1
0 0 0 0 0 0 0 1
1 1 0 0 1 1 1 0
0 0 0 1 1 1 1 0
1 1 0 0 1 1 1 0
0 1 1 1 0 1 1 0 0
Carry =0 means number is negative and in 2’s compl form
0 1 0 0 1 1
0 0 0 0 0 1
0 1 0 1 0 0 = -20
0 0 0 1 0 0 1 1
0 0 0 0 0 0 0 1
0 0 0 1 0 1 0 0 = -20
Add both the numbers
1: 6-bit number system 2: 8-bit number
system
01-10-2020 16Dr. Piyush Charan, Dept. of ECE, IU Lucknow