Convert Binary to Decimal
Duration: 7 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Quantitative Ability: Speed Mathematics and Basic Mathematics, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Speed Time and Distance, Number System, HCF LCM, Data Interpretation, Age Problems, Mixture and Alligation, Partnership, Algebra, Sequence and Series (Series), Mensuration and Geometry, Arithmetic
- Reasoning Ability: Puzzle Solving (Puzzles), Seating Arrangements, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Data Sufficiency, Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Analytical Reasoning (Counting Figures Reasoning), Data Arrangement, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning)
- Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Vocabulary, Sentence Completion (Fill in the blanks), Active Passive Voice (Voice), Direct and Indirect Speech, Subject Verb Agreement (Verb Noun Agreement), Tenses, Preposition, Articles, Sentence Correction (Error Correction)
- Programming Basics (MCQs + Interview): C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
- OOPs (MCQs + Interview): Object Oriented Programming (OOPS)
- DBMS (MCQs + Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Transaction Management, Decomposition Properties & 4NF, Concurrency Control, Database Recovery, File Organization & Indexing, Relational Algebra, Database Security & Authorization
- SQL (MCQs + Interview): SQL
- Operating Systems (MCQs + Interview): Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Process Synchronization, Disc Scheduling, File Management, Security
- Computer Networks (MCQs + Interview): Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Cloud Computing and IoT, Cyber and Info Security
- Coding: Coding Questions by Yash Sir
- HR Interview: MR & HR Interview Preparation
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This educational video from Knowledge Gate provides a comprehensive tutorial on converting a binary number to its decimal equivalent. The lesson begins by presenting the problem statement, which is to write a program for this conversion, and then shows several expected input-output examples, such as 111 converting to 7 and 1010 converting to 10. The core of the lesson is the algorithm, which is explained as a process of extracting digits from the binary number starting from the rightmost digit, multiplying each digit by the appropriate power of 2 (the base), and summing these values to get the final decimal result. This concept is illustrated with a detailed diagram for the binary number 1010, showing the calculation 1x2^3 + 0x2^2 + 1x2^1 + 0x2^0 = 10. Finally, the video presents a complete C program that implements this algorithm using a while loop, variable initialization, and arithmetic operations, with the instructor walking through the code step-by-step to demonstrate its logic.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with the Knowledge Gate logo, followed by a slide that introduces the topic of a programming problem: 'Write a program to convert Binary to Decimal'. The instructor, identified as Yash Jain Sir, a 'Placement Expert', presents the problem on a digital blackboard. The slide displays several expected input-output pairs to clarify the task, including Input: 111, Output: 7; Input: 1010, Output: 10; and Input: 100001, Output: 33. The instructor explains that the goal is to convert a given binary number into its decimal equivalent.
2:00 – 5:00 02:00-05:00
The instructor explains the algorithm for the conversion. The slide displays the text 'Algorithm:' and describes the process: extract digits from the rightmost side of the binary number, multiply each digit by the corresponding power of 2 (the base), and add the results to a variable 'dec_value'. An example is provided for the binary number 111, showing the calculation: 1*(2^2) + 1*(2^1) + 1*(2^0) = 7. The instructor then transitions to a diagram labeled 'Logic' that visually breaks down the conversion of the binary number 1010 into its decimal equivalent, showing the multiplication of each bit by its respective power of 2.
5:00 – 6:42 05:00-06:42
The video displays a C code snippet for the binary to decimal conversion. The code includes the function 'binaryToDecimal' which takes an integer 'n' as input. The function initializes variables 'num', 'dec_value', and 'base'. It uses a while loop to extract the last digit of the number using the modulo operator (%), adds the product of the digit and the current base to 'dec_value', and then updates the base by multiplying it by 2. The instructor explains this logic, and the code is annotated with handwritten notes on the blackboard, such as 'n = 1010', 'num = 1010', and 'base = 1', to illustrate the step-by-step execution of the algorithm.
The video provides a structured, step-by-step tutorial on the binary to decimal conversion. It begins with a clear problem statement and examples, then explains the underlying mathematical algorithm. This is followed by a visual representation of the logic, and finally, the implementation of the algorithm in C code. The progression from concept to code ensures a comprehensive understanding of the topic, making it suitable for students learning programming fundamentals.

