This document discusses the Luhn algorithm, which is used to validate identification numbers like credit card numbers. It describes the algorithm's strengths and weaknesses, provides an informal explanation of how it works with an example, and includes implementations in C# and pseudocode. The document also discusses how the Luhn algorithm is used to validate credit card numbers specifically, including the typical anatomy of a credit card number and how the check digit is generated.
The aim of this project is to controlling a wheel chair and electrical devices by using MEMS accelerometer sensor (Micro Electro-Mechanical Systems) technology. MEMS accelerometer sensor is a Micro Electro Mechanical Sensor which is a highly sensitive sensor and capable of detecting the tilt. This sensor finds the tilt and makes use of the accelerometer to change the direction of the wheel chair depending on tilt. For example if the tilt is to the right side then the wheel chair moves in right direction or if the tilt is to the left side then the wheel chair moves in left direction. Wheel chair movement can be controlled in Forward, Reverse, and Left and Right direction.
This document describes how to build a robot that can be controlled via Bluetooth from a mobile phone or PC. An HC-05 Bluetooth module connects to a microcontroller on the robot to receive commands from a Bluetooth-enabled device. The microcontroller then uses a motor driver IC to control the robot's motors to move forward, reverse, or turn based on the received commands.
This document describes a student engineering project to design a smart parking system. The system uses sensors and lights to guide drivers to available parking spaces and prevent spaces from being double parked. It counts the number of cars in each parking unit and displays the availability on an LCD screen. The circuit uses a PIC16F877A microcontroller to control sensors that detect car presence and switch lights from red to green. Photos show the model built with two parking units and an LCD display to indicate which spaces are available. Benefits include reducing time and fuel spent searching for parking.
This document describes the design of an omni-directional robot that can move in any direction. It uses three omni-wheels mounted at 120 degrees apart and driven by DC motors controlled by a microcontroller. The robot is designed to be controlled remotely using a DTMF decoder that interprets tones from a mobile phone. Software like Code Vision AVR, Proteus, and Sina Prog are used to program the microcontroller, simulate circuits, and download programs to the robot respectively. Omni-directional movement allows the robot to perform tasks like transporting items or serving food in any environment.
This document outlines a plan to create a bot that follows speech instructions. The bot will initially follow simple instructions like "go", "stop", "left", "right", and "back" using Google Speech for voice recognition and an Arduino board and motor circuit for movement. The plan is to eventually expand the bot to understand more complex commands.
This document summarizes a smart fuel theft detector system that uses ultrasonic sensors and microcontrollers. It detects fuel theft by monitoring fuel levels and comparing consumption rates to changes in fuel levels over time. The system measures fuel levels using ultrasonic sensors and slope sensors to account for tilting. A microcontroller filters readings and detects theft based on inconsistent fuel changes and consumption rates. It sends data to a database using GPRS modules for companies to monitor fuel usage. The system aims to prevent fuel theft from vehicle tanks and identify thieves.
To download the C# (sharp) tutorial PDF, copy and go through the link- goo.gl/K8yL1a
C# is the most powerful languages to work on .NET Framework and for all those who want to learn C#, I have something.
In this blog, you find the link for C# tutorial and you can also download it. It is helpful for both Novice, Beginners and Expert level people including Students/Engineers/Developers etc.
The aim of this project is to controlling a wheel chair and electrical devices by using MEMS accelerometer sensor (Micro Electro-Mechanical Systems) technology. MEMS accelerometer sensor is a Micro Electro Mechanical Sensor which is a highly sensitive sensor and capable of detecting the tilt. This sensor finds the tilt and makes use of the accelerometer to change the direction of the wheel chair depending on tilt. For example if the tilt is to the right side then the wheel chair moves in right direction or if the tilt is to the left side then the wheel chair moves in left direction. Wheel chair movement can be controlled in Forward, Reverse, and Left and Right direction.
This document describes how to build a robot that can be controlled via Bluetooth from a mobile phone or PC. An HC-05 Bluetooth module connects to a microcontroller on the robot to receive commands from a Bluetooth-enabled device. The microcontroller then uses a motor driver IC to control the robot's motors to move forward, reverse, or turn based on the received commands.
This document describes a student engineering project to design a smart parking system. The system uses sensors and lights to guide drivers to available parking spaces and prevent spaces from being double parked. It counts the number of cars in each parking unit and displays the availability on an LCD screen. The circuit uses a PIC16F877A microcontroller to control sensors that detect car presence and switch lights from red to green. Photos show the model built with two parking units and an LCD display to indicate which spaces are available. Benefits include reducing time and fuel spent searching for parking.
This document describes the design of an omni-directional robot that can move in any direction. It uses three omni-wheels mounted at 120 degrees apart and driven by DC motors controlled by a microcontroller. The robot is designed to be controlled remotely using a DTMF decoder that interprets tones from a mobile phone. Software like Code Vision AVR, Proteus, and Sina Prog are used to program the microcontroller, simulate circuits, and download programs to the robot respectively. Omni-directional movement allows the robot to perform tasks like transporting items or serving food in any environment.
This document outlines a plan to create a bot that follows speech instructions. The bot will initially follow simple instructions like "go", "stop", "left", "right", and "back" using Google Speech for voice recognition and an Arduino board and motor circuit for movement. The plan is to eventually expand the bot to understand more complex commands.
This document summarizes a smart fuel theft detector system that uses ultrasonic sensors and microcontrollers. It detects fuel theft by monitoring fuel levels and comparing consumption rates to changes in fuel levels over time. The system measures fuel levels using ultrasonic sensors and slope sensors to account for tilting. A microcontroller filters readings and detects theft based on inconsistent fuel changes and consumption rates. It sends data to a database using GPRS modules for companies to monitor fuel usage. The system aims to prevent fuel theft from vehicle tanks and identify thieves.
To download the C# (sharp) tutorial PDF, copy and go through the link- goo.gl/K8yL1a
C# is the most powerful languages to work on .NET Framework and for all those who want to learn C#, I have something.
In this blog, you find the link for C# tutorial and you can also download it. It is helpful for both Novice, Beginners and Expert level people including Students/Engineers/Developers etc.
Intelligent Edge - Getting started with TinyML for industrial applicationsJan Jongboom
This document discusses using machine learning for industrial applications with tiny machine learning (TinyML). It notes that 99% of sensor data from industrial sensors is discarded due to constraints. On-device intelligence using TinyML can help find patterns in this data. The document outlines steps for developing TinyML models, including collecting raw sensor data, extracting meaningful features from it, and training and deploying neural network models on edge devices. It provides examples of using TinyML for predictive maintenance, audible monitoring, and lone worker monitoring.
Big data refers to large and complex datasets that are difficult to process using traditional methods. Key challenges include capturing, storing, searching, sharing, and analyzing large datasets in domains like meteorology, physics simulations, biology, and the internet. Hadoop is an open-source software framework for distributed storage and processing of big data across clusters of computers. It allows for the distributed processing of large data sets in a reliable, fault-tolerant and scalable manner.
The Cisco Connected Roadways solution securely connects vehicles, infrastructure, and traffic management centers to improve safety, mobility and efficiency. It creates a wired and wireless network for vehicle-to-vehicle and vehicle-to-infrastructure communication to enable applications like traffic light control, smart parking, and traffic incident management. The solution components include onboard vehicle systems, roadside infrastructure, traffic management centers, and management platforms.
I am Vikram Kumar from Centurion University of Technology and Management.
An automated (car) parking system (APS) is a mechanical system designed to minimize the area and/or volume required for parking cars. Like a multi-story parking garage, an APS provides parking for cars on multiple levels stacked vertically to maximize the number of parking spaces while minimizing land usage. The APS, however, utilizes a mechanical system to transport cars to and from parking spaces (rather than the driver) in order to eliminate much of the space wasted in a multi-story parking garage.[1] While a multi-story parking garage is similar to multiple parking lots stacked vertically, an APS is more similar to an automated storage and retrieval system for cars.[1] The paternoster (shown animated at the right) is an example of one of the earliest and most common types of APS.[2]
APS are also generically known by a variety of other names, including: automated parking facility (APF), automated vehicle storage and retrieval system (AVSRS), car parking system, mechanical parking, and robotic parking garage.An automated (car) parking system (APS) is a mechanical system designed to minimize the area and/or volume required for parking cars. Like a multi-story parking garage, an APS provides parking for cars on multiple levels stacked vertically to maximize the number of parking spaces while minimizing land usage. The APS, however, utilizes a mechanical system to transport cars to and from parking spaces (rather than the driver) in order to eliminate much of the space wasted in a multi-story parking garage.[1] While a multi-story parking garage is similar to multiple parking lots stacked vertically, an APS is more similar to an automated storage and retrieval system for cars.[1] The paternoster (shown animated at the right) is an example of one of the earliest and most common types of APS.[2]
APS are also generically known by a variety of other names, including: automated parking facility (APF), automated vehicle storage and retrieval system (AVSRS), car parking system, mechanical parking, and robotic parking garage.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
This document contains information about Apache HBase including links to documentation pages, JIRA issues, and discussions on using HBase. It provides configuration examples for viewing HFile contents, explains how Bloom filters are used in HBase, includes an overview of the HBase data model and comparisons with RDBMS. It also shows an example Git diff of modifying the HBase heap size configuration and provides links to guides on using HBase and documentation on region splitting and merging.
UI layouts define the structure and organization of elements in an Android activity's user interface. There are two main options for declaring layouts: in XML files or programmatically in Java code. Common layout types include LinearLayout, RelativeLayout, TableLayout, and FrameLayout. Layout files use a tree structure with attributes like ID, width, height, and weight to position child views. This allows separation of UI design from activity code.
This document describes 5 experiments conducted in an IoT and ADBMS laboratory. The experiments cover topics like serial communication using UART, wireless communication between RF modules, reading sensor data from a DHT11 temperature and humidity sensor, and I2C communication between Arduino boards. Hardware components used include Arduino boards, RF transmitters/receivers, a DHT11 sensor, LCD display, LEDs, breadboard and connecting wires. The document provides aims, objectives, components, connections, procedures and code for each experiment.
The document discusses different types of polymorphism in C++ including function overloading, operator overloading, and virtual functions. It also covers key concepts related to pointers in C++ like pointer declaration syntax, dereferencing pointers, pointer arithmetic, arrays of pointers, pointers to functions, pointers to class members, and pointers to derived class objects.
The Android Open Accessory protocol allows communication between Android devices and USB accessories. It defines how Android apps declare support for accessories and how data is transferred over USB. Accessories identify themselves by sending strings to the Android device, then enter accessory mode to allow two-way communication over a USB interface using intents and file descriptors.
This document describes a system called "Accident Detection, Theft and Drive Protection using Intelligent Wireless Safety Helmet". The system consists of a helmet unit and vehicle unit that communicate wirelessly. The helmet unit ensures the rider is wearing a helmet and not under the influence of alcohol throughout the ride. If these conditions are not met, it communicates with the vehicle unit to prevent the ignition from starting. The vehicle unit detects accidents using sensors and notifies emergency contacts by SMS with the rider's location using GPS coordinates. The system also provides theft protection as the helmet is required along with the key to start the vehicle.
This document outlines the objectives and content of a 6-week Android application development course. The course will cover basic and advanced Java topics, the Android platform architecture including its Linux kernel, Dalvik VM, and application building blocks like Activities, Services, and ContentProviders. Students will learn to develop Android apps using Eclipse and the Android SDK, test apps on emulators and devices, and integrate features like notifications, location services, and XMPP messaging. The goal is to introduce students to mobile app development and the tools needed to build fully-functional Android apps.
1. The document discusses the evolution of computing from mainframes to smaller commodity servers and PCs. It then introduces cloud computing as an emerging technology that is changing the technology landscape, with examples like Google File System and Amazon S3.
2. It discusses the need for large data processing due to increasing amounts of data from sources like the stock exchange, Facebook, genealogy sites, and scientific experiments.
3. Hadoop is introduced as a framework for distributed computing and reliable shared storage and analysis of large datasets using its Hadoop Distributed File System (HDFS) for storage and MapReduce for analysis.
Menus are a common user interface component in many types of applications. To provide a familiar and consistent user experience, you should use the Menu APIs to present user actions and other options in your activities.
This document summarizes a traffic light control circuit project. The circuit uses an IC4017 decade counter and 555 timer to generate timing signals that control the lighting of red, yellow, and green LEDs in sequences that mimic standard traffic lights. The circuit was designed in Proteus and ARES circuit design software and implemented on a breadboard. Diagrams illustrate the circuit components, logic diagram of the IC4017, and characteristics of the IC4017 and 555 timer chips used. Screenshots show the circuit designs and a 3D view of the PCB layout.
The Android emulator allows developers to test Android applications without using physical devices. It simulates key aspects of an Android device including hardware, software, and various form factors. The emulator runs on the computer and displays an emulated Android device that developers can interact with. It supports running multiple emulated Android devices at once with varying configurations defined through Android Virtual Devices (AVDs). The emulator and AVDs allow easy prototyping and testing of Android applications across different device profiles before releasing to physical hardware.
Introduction to pointers and memory management in CUri Dekel
The document is an introduction to pointers and memory management in C. It discusses computer memory, how variables and function calls are implemented, and introduces pointers as a way to overcome limitations of passing arguments by value. It covers pointer arithmetic, arrays, and dynamic memory allocation using malloc and free. The goal is to help understand concepts and techniques while noting caveats.
This document proposes a metal detection robot that can detect metals ahead of it and avoid collisions using ultrasonic sensors. The robot uses an Arduino Uno microcontroller board to control two DC motors via a motor driver chip and detect metals using a metal detector coil. Ultrasonic sensors help the robot detect and avoid obstacles to provide a safe metal detecting robot that can operate in hazardous environments.
UIWebView displays web content by loading URLs or HTML data. It functions similarly to a standard web browser view but with limited external controls. The UIWebView delegate receives callbacks as web content loads, renders, or encounters errors. Developers can programmatically control loading, navigation, and interactions within the embedded web content area.
This document provides an overview of advanced data structures and algorithm analysis taught by Dr. Sukhamay Kundu at Louisiana State University. It discusses the role of data structures in making computations faster by supporting efficient data access and storage. The document distinguishes between algorithms, which determine the computational steps and data access order, and data structures, which enable efficient reading and writing of data. It also describes different methods for measuring algorithm performance, such as theoretical time complexity analysis and empirical measurements. Examples are provided for instrumenting code to count operations. Overall, the document introduces fundamental concepts about algorithms and data structures.
This document discusses number representation and arithmetic operations in computers using binary numbers. It covers topics like positive and negative number representation using 1's and 2's complement, how addition and subtraction are performed in 2's complement, and concepts like carry and overflow that can occur. Examples are provided to illustrate how binary numbers are converted between decimal values and their 1's and 2's complement representations, and how arithmetic operations are performed on these binary numbers in 2's complement format.
Intelligent Edge - Getting started with TinyML for industrial applicationsJan Jongboom
This document discusses using machine learning for industrial applications with tiny machine learning (TinyML). It notes that 99% of sensor data from industrial sensors is discarded due to constraints. On-device intelligence using TinyML can help find patterns in this data. The document outlines steps for developing TinyML models, including collecting raw sensor data, extracting meaningful features from it, and training and deploying neural network models on edge devices. It provides examples of using TinyML for predictive maintenance, audible monitoring, and lone worker monitoring.
Big data refers to large and complex datasets that are difficult to process using traditional methods. Key challenges include capturing, storing, searching, sharing, and analyzing large datasets in domains like meteorology, physics simulations, biology, and the internet. Hadoop is an open-source software framework for distributed storage and processing of big data across clusters of computers. It allows for the distributed processing of large data sets in a reliable, fault-tolerant and scalable manner.
The Cisco Connected Roadways solution securely connects vehicles, infrastructure, and traffic management centers to improve safety, mobility and efficiency. It creates a wired and wireless network for vehicle-to-vehicle and vehicle-to-infrastructure communication to enable applications like traffic light control, smart parking, and traffic incident management. The solution components include onboard vehicle systems, roadside infrastructure, traffic management centers, and management platforms.
I am Vikram Kumar from Centurion University of Technology and Management.
An automated (car) parking system (APS) is a mechanical system designed to minimize the area and/or volume required for parking cars. Like a multi-story parking garage, an APS provides parking for cars on multiple levels stacked vertically to maximize the number of parking spaces while minimizing land usage. The APS, however, utilizes a mechanical system to transport cars to and from parking spaces (rather than the driver) in order to eliminate much of the space wasted in a multi-story parking garage.[1] While a multi-story parking garage is similar to multiple parking lots stacked vertically, an APS is more similar to an automated storage and retrieval system for cars.[1] The paternoster (shown animated at the right) is an example of one of the earliest and most common types of APS.[2]
APS are also generically known by a variety of other names, including: automated parking facility (APF), automated vehicle storage and retrieval system (AVSRS), car parking system, mechanical parking, and robotic parking garage.An automated (car) parking system (APS) is a mechanical system designed to minimize the area and/or volume required for parking cars. Like a multi-story parking garage, an APS provides parking for cars on multiple levels stacked vertically to maximize the number of parking spaces while minimizing land usage. The APS, however, utilizes a mechanical system to transport cars to and from parking spaces (rather than the driver) in order to eliminate much of the space wasted in a multi-story parking garage.[1] While a multi-story parking garage is similar to multiple parking lots stacked vertically, an APS is more similar to an automated storage and retrieval system for cars.[1] The paternoster (shown animated at the right) is an example of one of the earliest and most common types of APS.[2]
APS are also generically known by a variety of other names, including: automated parking facility (APF), automated vehicle storage and retrieval system (AVSRS), car parking system, mechanical parking, and robotic parking garage.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
This document contains information about Apache HBase including links to documentation pages, JIRA issues, and discussions on using HBase. It provides configuration examples for viewing HFile contents, explains how Bloom filters are used in HBase, includes an overview of the HBase data model and comparisons with RDBMS. It also shows an example Git diff of modifying the HBase heap size configuration and provides links to guides on using HBase and documentation on region splitting and merging.
UI layouts define the structure and organization of elements in an Android activity's user interface. There are two main options for declaring layouts: in XML files or programmatically in Java code. Common layout types include LinearLayout, RelativeLayout, TableLayout, and FrameLayout. Layout files use a tree structure with attributes like ID, width, height, and weight to position child views. This allows separation of UI design from activity code.
This document describes 5 experiments conducted in an IoT and ADBMS laboratory. The experiments cover topics like serial communication using UART, wireless communication between RF modules, reading sensor data from a DHT11 temperature and humidity sensor, and I2C communication between Arduino boards. Hardware components used include Arduino boards, RF transmitters/receivers, a DHT11 sensor, LCD display, LEDs, breadboard and connecting wires. The document provides aims, objectives, components, connections, procedures and code for each experiment.
The document discusses different types of polymorphism in C++ including function overloading, operator overloading, and virtual functions. It also covers key concepts related to pointers in C++ like pointer declaration syntax, dereferencing pointers, pointer arithmetic, arrays of pointers, pointers to functions, pointers to class members, and pointers to derived class objects.
The Android Open Accessory protocol allows communication between Android devices and USB accessories. It defines how Android apps declare support for accessories and how data is transferred over USB. Accessories identify themselves by sending strings to the Android device, then enter accessory mode to allow two-way communication over a USB interface using intents and file descriptors.
This document describes a system called "Accident Detection, Theft and Drive Protection using Intelligent Wireless Safety Helmet". The system consists of a helmet unit and vehicle unit that communicate wirelessly. The helmet unit ensures the rider is wearing a helmet and not under the influence of alcohol throughout the ride. If these conditions are not met, it communicates with the vehicle unit to prevent the ignition from starting. The vehicle unit detects accidents using sensors and notifies emergency contacts by SMS with the rider's location using GPS coordinates. The system also provides theft protection as the helmet is required along with the key to start the vehicle.
This document outlines the objectives and content of a 6-week Android application development course. The course will cover basic and advanced Java topics, the Android platform architecture including its Linux kernel, Dalvik VM, and application building blocks like Activities, Services, and ContentProviders. Students will learn to develop Android apps using Eclipse and the Android SDK, test apps on emulators and devices, and integrate features like notifications, location services, and XMPP messaging. The goal is to introduce students to mobile app development and the tools needed to build fully-functional Android apps.
1. The document discusses the evolution of computing from mainframes to smaller commodity servers and PCs. It then introduces cloud computing as an emerging technology that is changing the technology landscape, with examples like Google File System and Amazon S3.
2. It discusses the need for large data processing due to increasing amounts of data from sources like the stock exchange, Facebook, genealogy sites, and scientific experiments.
3. Hadoop is introduced as a framework for distributed computing and reliable shared storage and analysis of large datasets using its Hadoop Distributed File System (HDFS) for storage and MapReduce for analysis.
Menus are a common user interface component in many types of applications. To provide a familiar and consistent user experience, you should use the Menu APIs to present user actions and other options in your activities.
This document summarizes a traffic light control circuit project. The circuit uses an IC4017 decade counter and 555 timer to generate timing signals that control the lighting of red, yellow, and green LEDs in sequences that mimic standard traffic lights. The circuit was designed in Proteus and ARES circuit design software and implemented on a breadboard. Diagrams illustrate the circuit components, logic diagram of the IC4017, and characteristics of the IC4017 and 555 timer chips used. Screenshots show the circuit designs and a 3D view of the PCB layout.
The Android emulator allows developers to test Android applications without using physical devices. It simulates key aspects of an Android device including hardware, software, and various form factors. The emulator runs on the computer and displays an emulated Android device that developers can interact with. It supports running multiple emulated Android devices at once with varying configurations defined through Android Virtual Devices (AVDs). The emulator and AVDs allow easy prototyping and testing of Android applications across different device profiles before releasing to physical hardware.
Introduction to pointers and memory management in CUri Dekel
The document is an introduction to pointers and memory management in C. It discusses computer memory, how variables and function calls are implemented, and introduces pointers as a way to overcome limitations of passing arguments by value. It covers pointer arithmetic, arrays, and dynamic memory allocation using malloc and free. The goal is to help understand concepts and techniques while noting caveats.
This document proposes a metal detection robot that can detect metals ahead of it and avoid collisions using ultrasonic sensors. The robot uses an Arduino Uno microcontroller board to control two DC motors via a motor driver chip and detect metals using a metal detector coil. Ultrasonic sensors help the robot detect and avoid obstacles to provide a safe metal detecting robot that can operate in hazardous environments.
UIWebView displays web content by loading URLs or HTML data. It functions similarly to a standard web browser view but with limited external controls. The UIWebView delegate receives callbacks as web content loads, renders, or encounters errors. Developers can programmatically control loading, navigation, and interactions within the embedded web content area.
This document provides an overview of advanced data structures and algorithm analysis taught by Dr. Sukhamay Kundu at Louisiana State University. It discusses the role of data structures in making computations faster by supporting efficient data access and storage. The document distinguishes between algorithms, which determine the computational steps and data access order, and data structures, which enable efficient reading and writing of data. It also describes different methods for measuring algorithm performance, such as theoretical time complexity analysis and empirical measurements. Examples are provided for instrumenting code to count operations. Overall, the document introduces fundamental concepts about algorithms and data structures.
This document discusses number representation and arithmetic operations in computers using binary numbers. It covers topics like positive and negative number representation using 1's and 2's complement, how addition and subtraction are performed in 2's complement, and concepts like carry and overflow that can occur. Examples are provided to illustrate how binary numbers are converted between decimal values and their 1's and 2's complement representations, and how arithmetic operations are performed on these binary numbers in 2's complement format.
This document provides an introduction to Python programming concepts including basic arithmetic operations, variables, data types, functions, strings, lists, conditional statements, while loops, and for loops. It explains key Python syntax such as operators, comments, functions, indexing lists, conditional checks, and loop structures. Examples are given for basic math calculations, string manipulation, list indexing/modification, conditional logic, and while/for loops. Key terms like integers, floats, booleans, strings, lists, tuples, dictionaries, if/else statements, comparison operators, and loop types are defined.
This document contains an exercise on digital electronics concepts including:
1. The differences between analog and digital measurements and pros and cons of analog vs digital electronics.
2. Tables defining binary, octal, decimal, and hexadecimal number systems.
3. Practice problems converting between number systems and performing basic binary math operations like addition, subtraction, multiplication, and division.
4. An independent practice section with additional problems converting between number systems and performing binary math.
This document discusses 2's complement arithmetic in digital electronics. It explains that subtracting one number from another is the same as making one number negative and adding them. It then demonstrates how to represent negative numbers in binary by taking the 2's complement of a number, which involves complementing all its digits and adding 1. Various examples are provided of adding positive and negative binary numbers by taking the 2's complement of negative terms before adding. The most significant bit is identified as the sign bit that determines if a number is positive or negative.
This document discusses 2's complement arithmetic in digital electronics. It explains that subtracting one number from another is the same as making one number negative and adding. It then demonstrates how to represent negative numbers in binary by taking the 2's complement of positive numbers. Finally, it provides examples of adding positive and negative binary numbers using the 2's complement process.
This document discusses 2's complement arithmetic in digital electronics. It explains that subtracting one number from another is the same as making one number negative and adding. It then demonstrates how to represent negative numbers in binary by taking the 2's complement of positive numbers. Finally, it provides examples of adding positive and negative binary numbers using the 2's complement process.
This document discusses 2's complement arithmetic in digital electronics. It explains that subtracting one number from another is the same as making one number negative and adding. It then demonstrates how to represent negative numbers in binary by taking the 2's complement of positive numbers. Finally, it provides examples of adding positive and negative binary numbers using the 2's complement process.
This document outlines the topics covered in the 21EC201 - Digital Principles and System Design course. It includes an introduction to number systems, logic gates, combinational logic circuits, Boolean algebra, truth tables and Karnaugh maps. Specific topics mentioned are binary, decimal, octal and hexadecimal number systems, logic gates like AND, OR, NAND, NOR, XOR and XNOR, arithmetic operations in binary and conversions between different number systems.
This chapter discusses different types of repetition statements in Java including while, do-while, for, and nested loops. It covers implementing repetition using these statements, choosing the appropriate one for a given task, and avoiding common pitfalls like off-by-one errors and infinite loops. Examples are provided to demonstrate generating tables with nested for loops and formatting output using the Formatter class.
Learn what is number system and related questions and if you like math related posts then visit my site to read more math related knowledgeable posts
you can also increase your knowledge about science and fascinating facts
Test your knowledge quizzes and more
It is very helpful for your exam preparation so stay tuned to my site to increase your knowledge and if you want to ask anything contact me through my site
BCS Certificate Level Examination. Computer and Network Technology (CNT) subject. Fundamentals of Computer Science. Data Representation in Computers. Learn about decimal, binary, octal and hexadecimal number systems and conversion between systems. Learn about binary addition and subtraction. For a complete subject coverage including Information Systems and Software Developments subjects, please visit to https://www.bcsonlinelectures.com/
This document provides an introduction to a digital design course. It discusses the recommended textbook, course description, grading breakdown, and course outline. The course focuses on fundamental digital concepts like number systems, Boolean algebra, logic gates, combinational and sequential logic. It will cover topics such as binary numbers, Boolean functions, logic gate minimization, adders/subtractors, multiplexers, flip-flops, and finite state machines. Students are expected to attend every lecture and participate in classroom discussions. Grades will be based on projects, midterm exams, and quizzes/assignments.
Digital systems process and store information in digital form using discrete values, usually binary digits 0 and 1. A computer manipulates information in binary form using transistors in on or off states. Digital systems are found in a wide range of applications and have advantages over analog systems like lower cost, greater reliability, and flexibility. Digital computers represent numbers, instructions, and data using binary numbers and perform arithmetic and logical operations on them.
there are different number system such as binary, decimal, octal and hexadecimal. binary has 2 digits 0 & 1. decimal has 0 to 9 digits. octal has 0 to 7 digits. and hexadecimal number system has 0 to 9 digits and 10 to 15 are denoted by alphabets. such as A=10, B=11 etc.
This document provides an overview of binary and other number systems used in computing. It discusses how computers use binary digits for operations while programmers find decimal more convenient. It then covers the basic binary, decimal, hexadecimal, and octal number systems including their digits and bases. The document also summarizes how to convert between these different number systems through examples of multiplication, division, and place value. Finally, it briefly mentions signed arithmetic, BCD, Gray code, logic gates, and flip-flops.
The document discusses different number systems used in computers such as binary, decimal, hexadecimal, and octal. It explains how computers use binary digits for operations and how different number systems are converted between each other. For example, binary numbers are converted to decimal by multiplying each bit by its place value and summing the results. Negative numbers are represented using ones' complement and twos' complement in binary. Basic logic gates and flip-flops used in digital circuits are also introduced.
Inductive programming incorporates all approaches which are concerned with learning programs or algorithms from incomplete (formal) specifications. Possible inputs in an IP system are a set of training inputs and corresponding outputs or an output evaluation function, describing the desired behavior of the intended program, traces or action sequences which describe the process of calculating specific outputs, constraints for the program to be induced concerning its time efficiency or its complexity, various kinds of background knowledge such as standard data types, predefined functions to be used, program schemes or templates describing the data flow of the intended program, heuristics for guiding the search for a solution or other biases.
Output of an IP system is a program in some arbitrary programming language containing conditionals and loop or recursive control structures, or any other kind of Turing-complete representation language.
In many applications the output program must be correct with respect to the examples and partial specification, and this leads to the consideration of inductive programming as a special area inside automatic programming or program synthesis, usually opposed to 'deductive' program synthesis, where the specification is usually complete.
In other cases, inductive programming is seen as a more general area where any declarative programming or representation language can be used and we may even have some degree of error in the examples, as in general machine learning, the more specific area of structure mining or the area of symbolic artificial intelligence. A distinctive feature is the number of examples or partial specification needed. Typically, inductive programming techniques can learn from just a few examples.
The diversity of inductive programming usually comes from the applications and the languages that are used: apart from logic programming and functional programming, other programming paradigms and representation languages have been used or suggested in inductive programming, such as functional logic programming, constraint
programming, probabilistic programming
Research on the inductive synthesis of recursive functional programs started in the early 1970s and was brought onto firm theoretical foundations with the seminal THESIS system of Summers[6] and work of Biermann.[7] These approaches were split into two phases: first, input-output examples are transformed into non-recursive programs (traces) using a small set of basic operators; second, regularities in the traces are searched for and used to fold them into a recursive program. The main results until the mid 1980s are surveyed by Smith.[8] Due to
The document discusses number systems and data representation in computers. It explains that computers use the binary number system to represent numeric and alphanumeric data. Binary representations allow computers to distinguish different states using digits of 0 and 1. The key points are:
- Computers use the binary system to represent data as strings of bits (0s and 1s) that can be processed electronically
- Numeric data such as integers are represented using binary formats like binary, sign-magnitude, 1's complement, and 2's complement
- Text and character data are represented using coding schemes like ASCII which assign a unique binary code to each character
- Floating point representation is used to store real numbers in a binary format using a sign bit,
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfTechgropse Pvt.Ltd.
In this blog post, we'll delve into the intersection of AI and app development in Saudi Arabia, focusing on the food delivery sector. We'll explore how AI is revolutionizing the way Saudi consumers order food, how restaurants manage their operations, and how delivery partners navigate the bustling streets of cities like Riyadh, Jeddah, and Dammam. Through real-world case studies, we'll showcase how leading Saudi food delivery apps are leveraging AI to redefine convenience, personalization, and efficiency.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
1. Các tài liệu về thuật toán Luhn 2008
Các tài liệu về thuật toán Luhn
Table of Contents
1. Luhn algorithm .................................................................................................................. 2
1.1. Strengths and weaknesses....................................................................................................... 2
1.2. Informal explanation................................................................................................................... 2
1.3. Example ....................................................................................................................................... 3
1.4. Implementation ........................................................................................................................... 4
2. Credit Card Validation - Check Digits .............................................................................. 6
2.1. Prefix, Length, and Check Digit Criteria.................................................................................. 6
2.2. LUHN Formula (Mod 10) for Validation of Primary Account Number ................................ 7
3. How To Generate *Valid* Credit Card Numbers .............................................................. 9
3.1. Typical credit card anatomy ...................................................................................................... 9
3.2. What is the “Luhn” or “Mod 10″ check? ................................................................................ 10
3.3. Credit card numbers valid or invalid? .................................................................................... 10
3.4. Closing remarks ........................................................................................................................ 12
3.5. Resources and References .................................................................................................... 13
4. Actionscript Credit Card Validation - Luhn Check.........................................................14
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 1
2. Các tài liệu về thuật toán Luhn 2008
1. Luhn algorithm
The Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm,
is a simple checksum formula used to validate a variety of identification numbers, such as credit
card numbers and Canadian Social Insurance Numbers. It was created by IBM scientist Hans
Peter Luhn and described in U.S. Patent 2,950,048 , filed on January 6, 1954, and granted on
August 23, 1960.
The algorithm is in the public domain and is in wide use today. It is not intended to be a
cryptographically secure hash function; it was designed to protect against accidental errors, not
malicious attacks. Most credit cards and many government identification numbers use the
algorithm as a simple method of distinguishing valid numbers from collections of random digits.
1.1. Strengths and weaknesses
The Luhn algorithm will detect any single-digit error, as well as almost all transpositions of
adjacent digits. It will not, however, detect transposition of the two-digit sequence 09 to 90 (or
vice versa). Other, more complex check-digit algorithms (such as the Verhoeff algorithm) can
detect more transcription errors. The Luhn mod N algorithm is an extension that supports non-
numerical strings.
Because the algorithm operates on the digits in a right-to-left manner and zero digits only affect
the result if they cause shift in position, zero-padding the beginning of a string of numbers does
not affect the calculation. Therefore, systems that normalize to a specific number of digits by
converting 1234 to 00001234 (for instance) can perform Luhn validation before or after the
normalization and achieve the same result.
The algorithm appeared in a US Patent for a hand-held, mechanical device for computing the
checksum. It was therefore required to be rather simple. The device took the mod 10 sum by
mechanical means. The substitution digits, that is, the results of the double and reduce
procedure, were not produced mechanically. Rather, the digits were marked in their permuted
order on the body of the machine.
1.2. Informal explanation
The formula verifies a number against its included check digit, which is usually appended to a
partial account number to generate the full account number. This account number must pass
the following test:
1. Counting from rightmost digit (which is the check digit) and moving left, double the value
of every even-positioned digit. For any digits that thus become 10 or more, take the two
numbers and add them together. For example, 1111 becomes 2121, while 8763
becomes 7733 (from 2×6=12 → 1+2=3 and 2×8=16 → 1+6=7).
2. Add all these digits together. For example, if 1111 becomes 2121, then 2+1+2+1 is 6;
and 8763 becomes 7733, so 7+7+3+3 is 20.
3. If the total ends in 0 (put another way, if the total modulus 10 is congruent to 0), then the
number is valid according to the Luhn formula; else it is not valid. So, 1111 is not valid
(as shown above, it comes out to 6), while 8763 is valid (as shown above, it comes out
to 20).
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 2
3. Các tài liệu về thuật toán Luhn 2008
1.3. Example
Consider the example identification number 446-667-651. The first step is to double every other
digit, counting from the second-to-last digit and moving left, and sum the digits in the result. The
following table shows this step (highlighted rows indicating doubled digits):
Digit Double Substitute Result
1 1 1
5 10 1+0 1
6 6 6
7 14 1+4 5
6 6 6
6 12 1+2 3
6 6 6
4 8 8 8
4 4 4
Total Sum: 40
The sum of 40 is divided by 10; the remainder is 0, so the number is valid.
A lookup table (i.e. calculate Double, Reduce, and Sum of digits only once and for all) can be
used (0123456789 is mapped to 0246813579)
Digit Double Substitute Result
0 0 0 0
1 2 2 2
2 4 4 4
3 6 6 6
4 8 8 8
5 10 1+0 1
6 12 1+2 3
7 14 1+4 5
8 16 1+6 7
9 18 1+8 9
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 3
4. Các tài liệu về thuật toán Luhn 2008
1.4. Implementation
This C# function implements the algorithm described above, returning true if the given array of
digits represents a valid Luhn number, and false otherwise.
bool CheckNumber(int[] digits)
{
int sum = 0;
bool alt = false;
for(int i = digits.Length - 1; i >= 0; i--)
{
if(alt)
{
digits[i] *= 2;
if(digits[i] > 9)
{
digits[i] -= 9;
}
}
sum += digits[i];
alt = !alt;
}
return sum % 10 == 0;
}
The following is an algorithm (in C#) to generate a number that passes the Luhn algorithm. It
fills an array with random digits then computes the sum of those numbers as shown above and
places the difference 10-sum (modulo 10) in the last element of the array.
int[] CreateNumber(int length)
{
Random random = new Random();
int[] digits = new int[length];
// For loop keeps default value of zero for last slot in array
for(int i = 0; i < length - 1; i++)
{
digits[i] = random.Next(10);
}
int sum = 0;
bool alt = true;
for(int i = length - 2; i >= 0; i--)
{
if(alt)
{
int temp = digits[i];
temp *= 2;
if(temp > 9)
{
temp -= 9;
}
sum += temp;
}
else
{
sum += digits[i];
}
alt = !alt;
}
int modulo = sum % 10;
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 4
5. Các tài liệu về thuật toán Luhn 2008
if(modulo > 0)
{
digits[length-1] = 10 - modulo;
}
// No else req'd - keep default value of zero for digits[length-1]
return digits;
}
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 5
6. Các tài liệu về thuật toán Luhn 2008
2. Credit Card Validation - Check Digits
This document outlines procedures and algorithms for Verifying the accuracy and validity of
credit card numbers. Most credit card numbers are encoded with a "Check Digit". A check digit
is a digit added to a number (either at the end or the beginning) that validates the authenticity of
the number. A simple algorithm is applied to the other digits of the number which yields the
check digit. By running the algorithm, and comparing the check digit you get from the algorithm
with the check digit encoded with the credit card number, you can verify that you have correctly
read all of the digits and that they make a valid combination.
Possible uses for this information:
When a user has keyed in a credit card number (or scanned it) and you want to validate
it before sending it our for debit authorization.
When issuing cards, say an affinity card, you might want to add a check digit using the
MOD 10 method.
2.1. Prefix, Length, and Check Digit Criteria
Here is a table outlining the major credit cards that you might want to validate.
CARD TYPE Prefix Length Check digit Algorithm
MASTERCARD 51-55 16 mod 10
VISA 4 13, 16 mod 10
34
AMEX 15 mod 10
37
300-305
Diners Club/ Carte Blanche 36 14 mod 10
38
Discover 6011 16 mod 10
2014
enRoute 15 any
2149
JCB 3 16 mod 10
2131
JCB 15 mod 10
1800
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 6
7. Các tài liệu về thuật toán Luhn 2008
2.2. LUHN Formula (Mod 10) for Validation of Primary Account Number
The following steps are required to validate the primary account number:
Step 1: Double the value of alternate digits of the primary account number beginning with the
second digit from the right (the first right--hand digit is the check digit.)
Step 2: Add the individual digits comprising the products obtained in Step 1 to each of the
unaffected digits in the original number.
Step 3: The total obtained in Step 2 must be a number ending in zero (30, 40, 50, etc.) for the
account number to be validated.
For example, to validate the primary account number 49927398716:
Step 1:
49927398716
x2 x2 x2 x2 x2
------------------------------
18 4 6 16 2
Step 2: 4 +(1+8)+ 9 + (4) + 7 + (6) + 9 +(1+6) + 7 + (2) + 6
Step 3: Sum = 70 : Card number is validated
Note: Card is valid because the 70/10 yields no remainder.
The great folks at ICVERIFY are the original source of this data, I only formatted it in HTML.
If you are in the market, I wrote a set of FoxPro modules for Windows/Dos that interface nicely
with ICVERIFY in a multi-user LAN setup. You just set up ICVERIFY on a single station, and all
stations on the LAN can authorize credit cards with a single FOXBASE function call. Of course,
you have to license ICVERIFY by the node, but it is very reasonable. I also wrote a couple of
simple functions to perform pre-authorization, card screening, etc.
Here is a Microsoft Excel worksheet that will validate a number for you (useful for understanding
the algorithm, it is in a .ZIP compressed format)
Horace Vallas made a NeoWebScript (Tcl really) procedure that implements it.
Check it out at https://enterprise.neosoft.com/secureforms/hav/
Because I get at least a letter a week regarding this routine, here are some additional helpful
notes:
Make sure that you:
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 7
8. Các tài liệu về thuật toán Luhn 2008
1. have started with the rightmost digit (including the check digit) (figure odd and even
based upon the rightmost digit being odd, regardless of the length of the Credit Card.)
ALWAYS work right to left.
2. the check digit counts as digit #1 (assuming that the rightmost digit is the check digit)
and is not doubled
3. double every second digit (starting with digit # 2 from the right)
4. remember that when you double a number over 4, (6 for example) you don't add the
result to your total, but rather the sum of the digits of the result (in the above example
6*2=12 so you would add 1+2 to your total (not 12).
5. always include the Visa or M/C/ prefix.
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 8
9. Các tài liệu về thuật toán Luhn 2008
3. How To Generate *Valid* Credit Card Numbers
What do the credit card numbers mean and how are they generated? I need to start with a disclaimer: Do
not use any credit card numbers, except your own, to buy things off internet. It’s wrong and it’s illegal. The
purpose of this post is *not* to create fraudulent workable card numbers. It is to explain the math and the
science behind those numbers that most of us see day in and day out; and hence this post should be
viewed from a purely academic perspective.
3.1. Typical credit card anatomy
Before we understand how credit card numbers are generated, here is a brief explanation of
what a typical credit card number means.
Out of the 16 numbers on a typical credit card, the set of first 6 digits is known as the
issuer identifier number (read this for details), and the last digit is known as the “check
digit” which is generated in such a way as to satisfy a certain condition (the Luhn or Mod
10 check). “Luhn check” is explained later in this post. The term sounds intimidating, but
it’s really a very simple (and elegant) concept.
Taking away the 6 identifier digits and 1 check digit leaves us with 9 digits in the middle
that form the “account number”.
Now, there are 10 possible numbers (from 0 to 9) that can be arranged in these 9
places. This gives rise to 109 combinations, that is, 1 billion possible account numbers
(per issuer identifier).
With each account number, there is always an unique check digit associated (for a given
issuer identifier and an account number, there cannot be more than one correct check
digit)
Amex issues credit cards with15 digits. The account numbers in this case are 8 digit
long.
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 9
10. Các tài liệu về thuật toán Luhn 2008
3.2. What is the “Luhn” or “Mod 10″ check?
In 1954, Hans Luhn of IBM proposed an algorithm to be used as a validity criterion for a given
set of numbers. Almost all credit card numbers are generated following this validity
criterion…also called as the Luhn check or the Mod 10 check. It goes without saying that the
Luhn check is also used to verify a given existing card number. If a credit card number does not
satisfy this check, it is not a valid number. For a 16 digit credit card number, the Luhn check can
be described as follows:
1. Starting with the check digit, double the value of every second digit (never double the
check digit). For example, in a 16 digit credit card number, double the 15th, 13th, 11th,
9th…digits (digits in odd places). In all, you will need to double eight digits.
2. If doubling of a number results in a two digit number, add up the digits to get a single
digit number. This will result in eight single digit numbers.
3. Now, replace the digits in the odd places (in the original credit card number) with these
new single digit numbers to get a new 16 digit number.
4. Add up all the digits in this new number. If the final total is perfectly divisible by 10, then
the credit card number is valid (Luhn check is satisfied), else it is invalid.
When credit card numbers are generated, the same steps are followed with one minor change.
First, the issuer identifier and account numbers are assigned (issuer numbers are fixed for a
given financial institution, whereas the account numbers are randomly allocated - I think). Then,
the check digit is assumed to be some variable, say X. After this, the above steps are followed,
and during the last step, X is chosen in such a way that it satisfies the Luhn check.
This part is a bit confusing and takes some time to understand. However, don’t get stuck
here…continue reading through the examples below and you will figure out what this is all
about.
3.3. Credit card numbers valid or invalid?
Have you ever wondered if those numbers on the fake plastic or cardboard credit cards that
come with the “preapproved” offers are real or imaginary? If they are not valid, how do you know
it?…Just apply the Luhn check and all the those fake credit cards will invariably fail.Here is an
example of a VISA credit card (look at the expiry date - 01/09 ..it’s still valid ! )
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 10
11. Các tài liệu về thuật toán Luhn 2008
Note that the credit card number starts with “4″…so it is indeed a VISA issued credit card (VISA
cards start with “4″ and MasterCard/Maestro cards start with “5″). Now, let us apply the Luhn
algorithm to this card. To make it easier on you guys, I have created a schematic of the steps
towards the Luhn check (below) for this card number 4552 7204 1234 5678:
In this case, when we sum up the total, it comes to 61 which is not perfectly divisible by
10, and hence this credit card number is invalid.
If such a credit card number is ever generated, the value of the check digit would be
adjusted in such a way as to satisfy the Luhn condition. In this case, the only value of the
check digit, that will create a valid credit card number, is 7. Choosing 7 as the check digit
will bring the total to 60 (which is perfectly divisible by 10) and the Luhn condition will be
satisfied. So the valid credit card number will be 4552 7204 1234 5677.
Let’s try another example, this time with a MasterCard.
Again, performing the Luhn check on this credit card number, we have:
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 11
12. Các tài liệu về thuật toán Luhn 2008
The total comes to 65 which is not perfectly divisible by 10. Hence this credit card
number is invalid.
In this case, a valid credit card number will result only if the check digit is 8. This will
bring the total to 70 which is perfectly divisible by 10. So the valid credit card number will
be 5490 1234 5678 9128.
3.4. Closing remarks
If I still have your attention, here are some additional thoughts. In the context of this post, by the
term “valid”, I mean “mathematically valid”. A mathematically valid credit card does not mean a
“working” credit card. The Luhn formula validates only the credit card number; it does not
validate the expiry date and/or card security code (CVV, CVC). Plus, as discussed before, the 9
digit account number will yield 1 billion combinations; so the chances of getting a working credit
card number are very remote. It should also be noted that, this validation is usually employed at
the transaction end; which means that numbers that do not satisfy the Luhn check are not
forwarded to the card issuer and the transaction is terminated. If you have a fake credit card
which satisfies the Luhn check, it will go through at the transaction end, but the card issuer will
most likely catch the mischief. So don’t go about trying to use these numbers to buy stuff.
Just to be clear on this, I don’t expect comments like these (check out the source of this
comment):
hey. im hearing good things about your site! i need some money to jump start my poker career.
Probably about 40-100$ would do. i dont have a credit card to use and it pisses me off because
i know i could beat the majority of the people online. please help
If you intend to post such comments, at least be extremely funny.
So you think you can separate out valid and invalid account numbers now? Here are a couple of
trial numbers for you:
5491 9469 1544 4923 - Valid or invalid? If invalid, what should have been the correct
check digit to make it valid?
4539 9920 4349 1562 - Valid or invalid? If invalid, what should have been the correct
check digit to make it valid?
Sudoku fans will quickly figure out multiple valid combinations of the above numbers. If you
don’t want to do the math, here are some ready made valid (”test”) credit card numbers from
Paypal.By the way, the Luhn check is also valid for debit card numbers.I am still in the learning
phase with this topic and trying to further understand how people use (or misuse (?)) such
information. If you have some insight in this matter, please feel free to share it with us.If you
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 12
13. Các tài liệu về thuật toán Luhn 2008
liked what you read above, go ahead and subscribe to this blog to get more updates. It’s easy -
just click on one of the buttons below and get the feed.
3.5. Resources and References
There is a vast amount of literature on the Luhn algorithm and a quick Google search will
enlighten you on how popular this topic is. If you don’t want to read all that, here are links to
some interesting reading.
Card Identification Features (pdf file) - extremely useful, must read.
Credit Card Numbers and Credit Card Generator @ Graham King.
Anatomy of Credit Card Numbers.
Credit Card Number - Wikipedia.
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 13
14. Các tài liệu về thuật toán Luhn 2008
4. Actionscript Credit Card Validation - Luhn Check
By no means did I write this, if you do a search for Luhn Check in google you will come with a million
results. However, most of them are Java implementations, JavaScript, ASP, JSP, but never ActionScript.
Below is a version I converted from Javascript into Actionscript 2.0. This Luhn Check validates the users
credit card numbers and makes sure A) there are enough for the given card, and B) matches the number
pattern of a given card. This example only checks Visa, MasterCard, American Express, and Diners Club.
BY NO MEANS IS THIS THE ONLY CHECK YOU NEED TO DO TO PROCESS AN
ORDER.
You must use a valid payment gateway that does proper server side credit card validation. The
purpose of this script is to reduce traffic to the server by weeding out the invalid credit card
numbers. If the client side tests are successful the application then has to send the Credit Card
information to the server for proper Credit Card Validation and order processing.
lass com.scottgmorgan.utils.CreditCardValidation {
/**
* checks for datein the format MM/YY or MM/YYYY against the current date
* @param month a number representing the month to be validated against.
* @param year a number representing the year to be validated against.
*/
public function isValidExpDate(month:Number,year:Number):Boolean {
var result:Boolean = true;
var now:Date = new Date();
var nowMonth:Number = now.getMonth() + 1;
var nowYear:Number = now.getFullYear();
if ((nowYear > year) || ((nowYear == year ) && (nowMonth > month))){
result = false;
}
return result;
}
/**
* checks for valid credit card format using the Luhn check and known digit
* about various cards
* @ccType a string indicating the entered credit card name
* @ccNum a string indicating the credit card number being used.
*/
public function
isValidCreditCardNumber(ccType:String,ccNum:String):Boolean {
var result:Boolean = true;
if (ccNum.length>0){
if (isNaN(ccNum)){
result = false;
}
if (result){
if (!luhnCheck(ccNum) || !validateCCNum(ccType,ccNum)){
result = false;
}
}
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 14
15. Các tài liệu về thuật toán Luhn 2008
}
return result;
}
private function luhnCheck(str:String){
var result:Boolean = true;
var sum:Number = 0;
var mul:Number = 1;
var strLen:Number = str.length;
for (var i:Number = 0; i < strLen; i++){
var digit:String = str.substring(strLen-i-1,strLen-i);
var tproduct:Number = parseInt(digit ,10)*mul;
if (tproduct >= 10){
sum += (tproduct % 10) + 1;
} else {
sum += tproduct;
}
if (mul == 1){
mul++;
} else {
mul--;
}
}
if ((sum % 10) != 0){
result = false;
}
return result;
}
private function validateCCNum(cardType:String,cardNum:String):Boolean{
var result:Boolean = false;
cardType = cardType.toUpperCase();
var cardLen:Number = cardNum.length;
var firstdig:String = cardNum.substring(0,1);
var seconddig:String = cardNum.substring(1,2);
var first4digs:String = cardNum.substring(0,4);
switch (cardType){
case "VISA":
result = ((cardLen == 16) || (cardLen == 13)) && (firstdig ==
"4");
break;
case "AMEX":
var validNums = "47";
result = (cardLen == 15) && (firstdig == "3") &&
(validNums.indexOf(seconddig)>=0);
break;
case "MASTERCARD":
var validNums = "12345";
result = (cardLen == 16) && (firstdig == "5") &&
(validNums.indexOf(seconddig)>=0);
break;
case "DISCOVER":
result = (cardLen == 16) && (first4digs == "6011");
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 15
16. Các tài liệu về thuật toán Luhn 2008
break;
case "DINERS":
var validNums = "068";
result = (cardLen == 14) && (firstdig == "3") &&
(validNums.indexOf(seconddig)>=0);
break;
}
return result;
}
}
And here is the sample code that instantiates this bad boy:
var ccValidator = new CreditCardValidation();
var valid = ccValidator.isValidCreditCardNumber('visa', '4111111111111111');
trace('card is valid: ' + valid);
Pretty straightforward. I have hardcoded the values in the method call above but in the real world
this would be puuled from a textfield or a combo box for the card type.
As a side note, if you ever want to get around the validation for Visa simply enter
„4111111111111111′ (1 “4″, and 15 “1‟s”). Unfortunatly, this number will not get you past the
real creditcard validation that occurs on the server or at the payment gateway.
Chuyên đề Thương Mại điện tử - Bộ môn Hệ thống thông tin – Khoa Công nghệ thông tin Page 16