Skip to main content

How do Computer Understand Humans Language



How Do Computer Understand Humans Language .....
Basic concepts of assembly and machine languages...
in this article, we talk about communication or interaction between computer and humans. humans can write, read or understand languages like Hindi, English etc.
But a computer doesn’t understand English; it only understands machine language. so here are some questions on the communication of computers and humans.

1. What is Machine Language?
In computer programming, machine code, consisting of machine language instructions, is a low-level programming language used to directly control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a very specific task, such as a load, a store, a jump, or an arithmetic logical unit (ALU) operation on one or more units of data in the CPU's registers or memory.

2. What is Assembly Language?
In computer programming, assembly language (or assembler language), often abbreviated asm, is any low-level programming language in which there is a very strong correspondence between the instructions in the language and the architecture's machine code instructions.
  • assembly depends on the machine code instructions.
  • every assembler has its own assembly language which is designed for exactly one specific computer architecture.
  • Assembly language may also be called symbolic machine code.


3. How assembler works?
The assembler works in two passes:
  pass1
    input scanning, collect symbols, generate a token list
  pass2
    generate object code from the token list

input scanning

symbol table

The predefined symbols are opcode, r0..r31, conditional.  the opcode is ld st jmp jal jr add sub mul div and or xor shl shr trap.  conditional are: always eq neq lt le ge gt.

pass1

  collect symbols and resolve reference
  build symbol table
  store token list

token list is an array of tokens.  Each token stores type, mode, reference and line number (refer to source code line number).  line number is used in reporting an error.  Type is sym num op dot.  The mode is addressing mode: absolute, displacement, index, immediate, reg-reg, reg-imm, special.

For example ld r1 @lv1 base  will generate the list of four tokens:
( notation : {type,mode,ref} )
{ {op,disp,ld}, {sym,reg,r1}, {sym,disp,lv1}, {sym,reg,base} }
 

pass 2

  generate code from the token list

the output format is suitable for a loader of the simulator

a num              set address
{l,d,x} num+       instruction
w num              defined word
e                  end of file


references: en.wikipedia.org

Comments

Popular posts from this blog

How To Know Best Tools For Social Media Marketing Part 2

  Best Tools For Social Media Marketing Part 2 Today we will tell you about social media marketing tools Part 2. in this article remaining 6 tools, which are helping in a social media campaign. Unsplash: - It is very important to have amazing images while having high-quality textual content. Unsplash provides a database of high-resolution, great images that you can use with your posts, the fact that a good image has its own unique significance cannot be denied. Each image is properly tagged so that you can find the most appropriate image for your post. Marin: - If your agency runs a social media advertising campaign (campaign), then this social media management tool will be useful for you. Marin offers a range of features that promise to increase your ROI by up to 30% compared to native equipment. One of its cool features is called auto-split which helps your audience in the micro-segment. Nimble: - As your customer list grows, a powerful CRM is needed to automate data manag...