SlideShare a Scribd company logo
Relationship between Hardware and Software
&
Analog Electronics
Nahin Ul Sadad
Lecturer
CSE, RUET
Relationship between Hardware and
Software
Question: Can high level language program (Software)
be run on computer processor (Hardware) directly?
Ans: Computer understands only program written in 0/1. It is called
Machine Code/Program.
So, High level language program must be converted to Machine
Language Program.
High Level Language Program → Assembly Language Program → Machine Language Program
int main()
{
int a=10;
a=a+5;
return 0;
}
call ___main
mov DWORD PTR [esp+12], 10
add DWORD PTR [esp+12], 5
mov eax, 0
c7 44 24 0c 0a 00 00
83 44 24 0c 05
b8 00 00 00 00
Compiler Assembler
Question: What kind of machine code does
computer processor understand?
Ans: Every computer processor has something called Instruction
Set Architecture (ISA) which defines machine code for specific
instruction.
Compiler/Assembler must generate machine code based on ISA. ISA
is the one that connects Hardware and Software together.
Question: How does computer processor itself run
machine code?
Ans: Every modern processor is based on Von Neumann Model.
Figure: Von Neumann Model
Arithmetic and Logic Unit (ALU)
Control Unit (CU)
Register Set
Central Processing Unit (CPU)
Main Memory
1. Computer will fetch instruction from Main Memory (RAM).
2. Instruction will be decoded by control unit and will select
registers and/or immediate values.
3. Data within registers and/or immediate values will be sent
to Arithmetic and Logic Unit (ALU) to perform operations.
4. ALU will perform operation and result will be sent to the
register to be written.
5. Control unit can send data from registers to Main memory.
Question: How are computer building blocks like
ALU, CU, Register Set, Main Memory etc. made of?
Ans: They are made of digital electronics building
block like AND/OR etc.
Question: How are digital electronics building
block like AND/OR etc. made of?
Ans: They are made of analog electronics building
block called transistor.
Question: How does a high level language
program run on transistor inside of computer
processor?
Answer: Connection between High Level Language Program and Transistor
High Level Language Program
Assembly Language Program
Compiler
Machine Language Program
Assembler
Instruction Set Architecture
Computer Architecture
Digital Electronics
Analog Electronics
Physics (Law of Nature)
int main(){int a=10; a=a+5; return 0;}
mov DWORD PTR [rbp-4], 10
add DWORD PTR [rbp-4], 5
c7 45 fc 0a 00 00 00
83 45 fc 05
Software
Hardware
ALU CU Register Set Main Memory
Multiplier Flip-flop
Adder
c7 is opcode for mov
83 is opcode for add
From Intel ISA
Transistor
(Acts as a switch)
Analog Electronics I
Question: What is the role of transistor?
Answer: Transistor works as
1. Switch and
2. Amplifier
Question: Explain the role of transistor in computer
processor.
Answer: Transistor works as switch inside computer
processor.
Question: How does BJT transistor work as switch?
Answer:
Transistor Circuit Diagram
2-input Transistor AND Gate
Link: https://www.electronics-tutorials.ws/logic/logic_2.html
2-input Transistor OR Gate
Link: https://www.electronics-tutorials.ws/logic/logic_3.html
1-input Transistor NOT Gate (Inverter)
Link: https://www.electronics-tutorials.ws/logic/logic_4.html
Question: Implement NOR (A + B) logic gate by
using BJT transistor.
Ans: 2-input NOR Gate
Q = A + B
Ans: Equivalent 2-input NOR Gate
Link: https://www.electronics-tutorials.ws/logic/logic_6.html
Question: What type of transistor is used in real
life modern processor?
Answer:
CMOS = Complementary Metal–Oxide–
Semiconductor Field Effect Transistor
Example: BJT
Question: Implement 𝑨 + 𝑩 𝑩 + 𝑪 by using BJT transistor.
Answer:
Exercises
1. Implement NOR ( 𝑨 + 𝑩)/ 𝑨 + 𝑩 + 𝑪/ 𝑨 + 𝑩 𝑩 + 𝑪 /any Boolean expression by using BJT
transistor.
Thank You ☺

More Related Content

Similar to Introduction 1 - Relationship between hardware and software & Analog Electronics I v2.pdf

Computer architecture is made up of two main components the Instruct.docx
Computer architecture is made up of two main components the Instruct.docxComputer architecture is made up of two main components the Instruct.docx
Computer architecture is made up of two main components the Instruct.docx
brownliecarmella
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
Ravikumar Tiwari
 
intoduction to Computer programming java learn for more chapter contact salma...
intoduction to Computer programming java learn for more chapter contact salma...intoduction to Computer programming java learn for more chapter contact salma...
intoduction to Computer programming java learn for more chapter contact salma...
Syed Shah
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthingtonoscon2007
 
SequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshareSequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshare
Doug Norton
 
SequenceL intro slideshare
SequenceL intro slideshareSequenceL intro slideshare
SequenceL intro slideshare
Doug Norton
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
mustafkhalid
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
Abdul Khan
 
Microprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdfMicroprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdf
Engineering Funda
 
Introduction To Computer and Java
Introduction To Computer and JavaIntroduction To Computer and Java
Introduction To Computer and Java
PRN USM
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Shubhrika Sehgal
 
Programming in c
Programming in cProgramming in c
Programming in c
indra Kishor
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
Keerty Smile
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
Aftab Ahmad
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler Programming
Omar Sanchez
 
Basic of Computer By Rimon Rayhan
Basic of Computer By Rimon RayhanBasic of Computer By Rimon Rayhan
Basic of Computer By Rimon Rayhan
BUBT-Bangladesh University of Business and Tecnology
 
l1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptxl1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptx
ssuser6f38e5
 

Similar to Introduction 1 - Relationship between hardware and software & Analog Electronics I v2.pdf (20)

Computer architecture is made up of two main components the Instruct.docx
Computer architecture is made up of two main components the Instruct.docxComputer architecture is made up of two main components the Instruct.docx
Computer architecture is made up of two main components the Instruct.docx
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
 
intoduction to Computer programming java learn for more chapter contact salma...
intoduction to Computer programming java learn for more chapter contact salma...intoduction to Computer programming java learn for more chapter contact salma...
intoduction to Computer programming java learn for more chapter contact salma...
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
SequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshareSequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshare
 
SequenceL intro slideshare
SequenceL intro slideshareSequenceL intro slideshare
SequenceL intro slideshare
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Microprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdfMicroprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdf
 
Introduction To Computer and Java
Introduction To Computer and JavaIntroduction To Computer and Java
Introduction To Computer and Java
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler Programming
 
CISY 105 Chapter 1
CISY 105 Chapter 1CISY 105 Chapter 1
CISY 105 Chapter 1
 
Basic of Computer By Rimon Rayhan
Basic of Computer By Rimon RayhanBasic of Computer By Rimon Rayhan
Basic of Computer By Rimon Rayhan
 
l1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptxl1-introduction_to_computers_and_c_programming.pptx
l1-introduction_to_computers_and_c_programming.pptx
 

Recently uploaded

ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 

Recently uploaded (20)

ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 

Introduction 1 - Relationship between hardware and software & Analog Electronics I v2.pdf

  • 1. Relationship between Hardware and Software & Analog Electronics Nahin Ul Sadad Lecturer CSE, RUET
  • 3. Question: Can high level language program (Software) be run on computer processor (Hardware) directly? Ans: Computer understands only program written in 0/1. It is called Machine Code/Program. So, High level language program must be converted to Machine Language Program.
  • 4. High Level Language Program → Assembly Language Program → Machine Language Program int main() { int a=10; a=a+5; return 0; } call ___main mov DWORD PTR [esp+12], 10 add DWORD PTR [esp+12], 5 mov eax, 0 c7 44 24 0c 0a 00 00 83 44 24 0c 05 b8 00 00 00 00 Compiler Assembler
  • 5. Question: What kind of machine code does computer processor understand? Ans: Every computer processor has something called Instruction Set Architecture (ISA) which defines machine code for specific instruction. Compiler/Assembler must generate machine code based on ISA. ISA is the one that connects Hardware and Software together.
  • 6. Question: How does computer processor itself run machine code? Ans: Every modern processor is based on Von Neumann Model. Figure: Von Neumann Model Arithmetic and Logic Unit (ALU) Control Unit (CU) Register Set Central Processing Unit (CPU) Main Memory
  • 7. 1. Computer will fetch instruction from Main Memory (RAM). 2. Instruction will be decoded by control unit and will select registers and/or immediate values. 3. Data within registers and/or immediate values will be sent to Arithmetic and Logic Unit (ALU) to perform operations. 4. ALU will perform operation and result will be sent to the register to be written. 5. Control unit can send data from registers to Main memory.
  • 8. Question: How are computer building blocks like ALU, CU, Register Set, Main Memory etc. made of? Ans: They are made of digital electronics building block like AND/OR etc.
  • 9. Question: How are digital electronics building block like AND/OR etc. made of? Ans: They are made of analog electronics building block called transistor.
  • 10. Question: How does a high level language program run on transistor inside of computer processor?
  • 11. Answer: Connection between High Level Language Program and Transistor High Level Language Program Assembly Language Program Compiler Machine Language Program Assembler Instruction Set Architecture Computer Architecture Digital Electronics Analog Electronics Physics (Law of Nature) int main(){int a=10; a=a+5; return 0;} mov DWORD PTR [rbp-4], 10 add DWORD PTR [rbp-4], 5 c7 45 fc 0a 00 00 00 83 45 fc 05 Software Hardware ALU CU Register Set Main Memory Multiplier Flip-flop Adder c7 is opcode for mov 83 is opcode for add From Intel ISA Transistor (Acts as a switch)
  • 13. Question: What is the role of transistor? Answer: Transistor works as 1. Switch and 2. Amplifier
  • 14. Question: Explain the role of transistor in computer processor. Answer: Transistor works as switch inside computer processor.
  • 15. Question: How does BJT transistor work as switch? Answer:
  • 17. 2-input Transistor AND Gate Link: https://www.electronics-tutorials.ws/logic/logic_2.html
  • 18. 2-input Transistor OR Gate Link: https://www.electronics-tutorials.ws/logic/logic_3.html
  • 19. 1-input Transistor NOT Gate (Inverter) Link: https://www.electronics-tutorials.ws/logic/logic_4.html
  • 20. Question: Implement NOR (A + B) logic gate by using BJT transistor. Ans: 2-input NOR Gate Q = A + B
  • 21. Ans: Equivalent 2-input NOR Gate Link: https://www.electronics-tutorials.ws/logic/logic_6.html
  • 22. Question: What type of transistor is used in real life modern processor? Answer: CMOS = Complementary Metal–Oxide– Semiconductor Field Effect Transistor
  • 23. Example: BJT Question: Implement 𝑨 + 𝑩 𝑩 + 𝑪 by using BJT transistor. Answer:
  • 24. Exercises 1. Implement NOR ( 𝑨 + 𝑩)/ 𝑨 + 𝑩 + 𝑪/ 𝑨 + 𝑩 𝑩 + 𝑪 /any Boolean expression by using BJT transistor.