На
6 отговора
228 прегледа
На
какъв програмен език се пишат драйверите. В у-ще са ни учили само на езици от високо ниво(Java, С++), в началото сме. Каква е разликата между 16 битовия, 32 битовия и 64 битовия софтуер и къде се пише кода за различни видове процесори? Калкулаторът в уин може да смята до 32 цифри, може ли повече при 64 битова версия? Много се нтересувам.
Re: На
Началото на всичко почва от "Тука има, тука нема". Демек - двоичната бройна система. 0 - няма, 1 - има. Но хайде да започнем малко по-отначало, и ще разгледаме за пример нещо по-опростено.
Да кажем, че имаме 8-битов процесор. Неговата "шина за данни" е изградена механично от 8 писти, свързващи се с 8 крачета на самия чип. И тъй като процесора е чисто логическа схема, на тези изводи не може да има междинни нива на напрежението. Приема се (в идеалния вариант) че 0 волта е логическа нула, а 5 волта е логическа единица. И как процесора подава дадено число по тази шина ... естествено че с комбинация от 8-те си крачета. Числото 0 се предава като "00000000", а числото 35 например е като "00100011" и т.н. до запълване на капацитета на шината - 255 е "11111111". ... Как тогава се изчисляват числа по-големи от 255 ли? ;о)) Като се прави мантиса в паметта. Тя може да е широка 1, 2, 4 или 8 байта, и в зависимост от типа на числото дали е цяло число, дробно с единична прецизност, или с двойна прецизност - се определя и максималната стойност на числото, с което може да се работи. Разбира се, за да получи по-добър поглед върху нещата, човек трябва да се позанимае с Асемблер. Но аз лично не съм се хващал с него от времето на "Правец 82", където пишехме малко 16-тично кодиране (то пак не е точно асемблер, а е още по-ниско и от него). ;о)
Аналогично на досегашните сметки - с 8 бита могат да се прехвърлят числа от 0 до 255. А с 16 бита - от 0 до 65535. А защо не до 512 ли? ;о) Защото с всеки нов бит прибавен към шината - се удвоява и броя възможни "комбинации" от единици и нули, който може да се получи. С един бит може да се прехвърлят числа от 0 до 1 (две числа), с два бита - от 0 до 3 (четири числа), с три бита - от 0 до 7 (осем числа), с четири бита - от 0 до 15 (16 числа), с пет бита - от 0 до 31 (32 числа)... ... ... 8 бита - 0 до 255 (256 числа), 9 бита - 0 до 511 (512 числа)... и т.н. всяки следващ бит е равен на 2 на степен - поредния номер на бита-1. Т.е. 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - ще е равно на: 128+64+32+16+8+4+2+1=255.
Но! За да се прехвърли по-голямо число, съответно по-широка мантиса - ще трябват 2 или 4 процесорни такта. Т.е. повече време. В това отношение 16-битовите процесори ще могат същото за по-малко процесорни такта. А 32-битовите... (за 64-битовите нямам инфо какво толкова революционно има в тях).
Колкото до софтуера. Да кажем, че инструкциите се пишат с по един байт (1 байт = 8 бита), то тогава общо възможни инструкции ще са 255 (всъщност създателите на процесорите и Асемблер не ги запълват всичките), като за всяка възможна инструкция следва да се знае дали след нея следва (или не) още един или два байта. Като пример мога да дам инструкция от добрия стар "Правец 82". Например "4C" (16-тично) е инструкция за безусловен преход. И след нея следват още два байта, които са данни. Те също се записват с 16-тични числа. По стандарт първо се записва младшия полу-байт, и след него старшия. В асемблер тази инструкция се записва "JMP 0300" (например), а в 16-тично кодиране: "4C 00 03". ... И понеже езиците отдавна са минали нивото на "Правец 82", следва че и инструкциите в съвременния Асемблер могат да се записват с повече от един байт. С което броя им нараства. А това става съответно с повече битове на процесора...
...
Хайде, ако има някой по-навътре в нещата, да пообясни повече, щото знанията ми недостигат изобщо за тая тема. Хич не знам и що ли писах, ама...
Да кажем, че имаме 8-битов процесор. Неговата "шина за данни" е изградена механично от 8 писти, свързващи се с 8 крачета на самия чип. И тъй като процесора е чисто логическа схема, на тези изводи не може да има междинни нива на напрежението. Приема се (в идеалния вариант) че 0 волта е логическа нула, а 5 волта е логическа единица. И как процесора подава дадено число по тази шина ... естествено че с комбинация от 8-те си крачета. Числото 0 се предава като "00000000", а числото 35 например е като "00100011" и т.н. до запълване на капацитета на шината - 255 е "11111111". ... Как тогава се изчисляват числа по-големи от 255 ли? ;о)) Като се прави мантиса в паметта. Тя може да е широка 1, 2, 4 или 8 байта, и в зависимост от типа на числото дали е цяло число, дробно с единична прецизност, или с двойна прецизност - се определя и максималната стойност на числото, с което може да се работи. Разбира се, за да получи по-добър поглед върху нещата, човек трябва да се позанимае с Асемблер. Но аз лично не съм се хващал с него от времето на "Правец 82", където пишехме малко 16-тично кодиране (то пак не е точно асемблер, а е още по-ниско и от него). ;о)
Аналогично на досегашните сметки - с 8 бита могат да се прехвърлят числа от 0 до 255. А с 16 бита - от 0 до 65535. А защо не до 512 ли? ;о) Защото с всеки нов бит прибавен към шината - се удвоява и броя възможни "комбинации" от единици и нули, който може да се получи. С един бит може да се прехвърлят числа от 0 до 1 (две числа), с два бита - от 0 до 3 (четири числа), с три бита - от 0 до 7 (осем числа), с четири бита - от 0 до 15 (16 числа), с пет бита - от 0 до 31 (32 числа)... ... ... 8 бита - 0 до 255 (256 числа), 9 бита - 0 до 511 (512 числа)... и т.н. всяки следващ бит е равен на 2 на степен - поредния номер на бита-1. Т.е. 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - ще е равно на: 128+64+32+16+8+4+2+1=255.
Но! За да се прехвърли по-голямо число, съответно по-широка мантиса - ще трябват 2 или 4 процесорни такта. Т.е. повече време. В това отношение 16-битовите процесори ще могат същото за по-малко процесорни такта. А 32-битовите... (за 64-битовите нямам инфо какво толкова революционно има в тях).
Колкото до софтуера. Да кажем, че инструкциите се пишат с по един байт (1 байт = 8 бита), то тогава общо възможни инструкции ще са 255 (всъщност създателите на процесорите и Асемблер не ги запълват всичките), като за всяка възможна инструкция следва да се знае дали след нея следва (или не) още един или два байта. Като пример мога да дам инструкция от добрия стар "Правец 82". Например "4C" (16-тично) е инструкция за безусловен преход. И след нея следват още два байта, които са данни. Те също се записват с 16-тични числа. По стандарт първо се записва младшия полу-байт, и след него старшия. В асемблер тази инструкция се записва "JMP 0300" (например), а в 16-тично кодиране: "4C 00 03". ... И понеже езиците отдавна са минали нивото на "Правец 82", следва че и инструкциите в съвременния Асемблер могат да се записват с повече от един байт. С което броя им нараства. А това става съответно с повече битове на процесора...
...
Хайде, ако има някой по-навътре в нещата, да пообясни повече, щото знанията ми недостигат изобщо за тая тема. Хич не знам и що ли писах, ама...
Re: На
А ето какво са писали Майкрософт в своята Encarta Refference Library 2004 по отношение на процесорите:
"Microprocessor, 80286, in computer science, also called the 286. A 16-bit microprocessor from Intel, introduced in 1982 and included in the IBM PC/AT and compatible computers in 1984. The 80286 has 16-bit registers, transfers information over the data bus 16 bits at a time, and uses 24 bits to address memory locations. The 80286 operates in two modes, real (which is compatible with MS-DOS and the limits of the 8086 and 8088 chips) and protected (which increases the microprocessor's functionality). Real mode limits the amount of memory the microprocessor can address to 1 megabyte; in protected mode, however, the 80286 can directly access 16 megabytes of memory. In addition, an 80286 in protected mode protects the operating system from ill-behaved applications that normally could halt (or “crash”) a system with a nonprotected microprocessor such as the 80286 in real mode or the 8088."
"Microprocessor, 80386SX, in computer science, also called the 386SX. A microprocessor from Intel, introduced in 1988 as a low-cost alternative to the 80386DX. The 80386SX is basically an 80386DX processor limited by a 16-bit data bus. The 16-bit design allows 80386SX systems to be configured from less expensive AT-class parts, resulting in a much lower total system price. The 80386SX offers improved performance over the 80286 and access to software designed for the 80386DX. The 80386SX also offers 80386DX features such as multitasking and virtual 8086 mode."
"Microprocessor, 80386DX, in computer science, also called the 80386, 386, and 386DX. A 32-bit microprocessor from Intel, introduced in 1985 and used in IBM and compatible microcomputers such as the PS/2 Model 80. The 80386 is a full 32-bit microprocessor, meaning that it has 32-bit registers, it can transfer information over its data bus 32 bits at a time, and it can use 32 bits in addressing memory. Like the earlier 80286, the 80386 operates in two modes, real (which is compatible with MS-DOS and the limits of the 8086 and 8088 chips) and protected (which increases the microprocessor's functionality and protects the operating system from halting because of an inadvertent application program error). Real mode limits the amount of memory that the microprocessor can address to 1 megabyte; in protected mode, however, the total amount of memory that the 80386 can address directly is 4 gigabytes (roughly 4 billion bytes). The 80386 also includes a virtual 8086 mode, which allows operating systems to effectively divide the 80386DX into several 8086 microprocessors each having its own 1-megabyte space, allowing each “8086” to run its own program."
"HISTORY OF THE MICROPROCESSOR
The first microprocessor was the Intel 4004, produced in 1971. Originally developed for a calculator, and revolutionary for its time, it contained 2,300 transistors on a 4-bit microprocessor that could perform only 60,000 operations per second. The first 8-bit microprocessor was the Intel 8008, developed in 1972 to run computer terminals. The Intel 8008 contained 3,300 transistors. The first truly general-purpose microprocessor, developed in 1974, was the 8-bit Intel 8080 (see Microprocessor, 8080), which contained 4,500 transistors and could execute 200,000 instructions per second. By 1989, 32-bit microprocessors containing 1.2 million transistors and capable of executing 20 million instructions per second had been introduced.
In the 1990s the number of transistors on microprocessors continued to double nearly every 18 months. The rate of change followed an early prediction made by American semiconductor pioneer Gordon Moore. In 1965 Moore predicted that the number of transistors on a computer chip would double every year, a prediction that has come to be known as Moore’s Law. In the mid-1990s chips included the Intel Pentium Pro, containing 5.5 million transistors; the UltraSparc-II, by Sun Microsystems, containing 5.4 million transistors; the PowerPC620, developed jointly by Apple, IBM, and Motorola, containing 7 million transistors; and the Digital Equipment Corporation's Alpha 21164A, containing 9.3 million transistors. By the end of the decade microprocessors contained many millions of transistors, transferred 64 bits of data at once, and performed billions of instructions per second.
Contributed By:
Gary H. Bernstein
© 1993-2003 Microsoft Corporation. All rights reserved."
"Microprocessor, 80286, in computer science, also called the 286. A 16-bit microprocessor from Intel, introduced in 1982 and included in the IBM PC/AT and compatible computers in 1984. The 80286 has 16-bit registers, transfers information over the data bus 16 bits at a time, and uses 24 bits to address memory locations. The 80286 operates in two modes, real (which is compatible with MS-DOS and the limits of the 8086 and 8088 chips) and protected (which increases the microprocessor's functionality). Real mode limits the amount of memory the microprocessor can address to 1 megabyte; in protected mode, however, the 80286 can directly access 16 megabytes of memory. In addition, an 80286 in protected mode protects the operating system from ill-behaved applications that normally could halt (or “crash”) a system with a nonprotected microprocessor such as the 80286 in real mode or the 8088."
"Microprocessor, 80386SX, in computer science, also called the 386SX. A microprocessor from Intel, introduced in 1988 as a low-cost alternative to the 80386DX. The 80386SX is basically an 80386DX processor limited by a 16-bit data bus. The 16-bit design allows 80386SX systems to be configured from less expensive AT-class parts, resulting in a much lower total system price. The 80386SX offers improved performance over the 80286 and access to software designed for the 80386DX. The 80386SX also offers 80386DX features such as multitasking and virtual 8086 mode."
"Microprocessor, 80386DX, in computer science, also called the 80386, 386, and 386DX. A 32-bit microprocessor from Intel, introduced in 1985 and used in IBM and compatible microcomputers such as the PS/2 Model 80. The 80386 is a full 32-bit microprocessor, meaning that it has 32-bit registers, it can transfer information over its data bus 32 bits at a time, and it can use 32 bits in addressing memory. Like the earlier 80286, the 80386 operates in two modes, real (which is compatible with MS-DOS and the limits of the 8086 and 8088 chips) and protected (which increases the microprocessor's functionality and protects the operating system from halting because of an inadvertent application program error). Real mode limits the amount of memory that the microprocessor can address to 1 megabyte; in protected mode, however, the total amount of memory that the 80386 can address directly is 4 gigabytes (roughly 4 billion bytes). The 80386 also includes a virtual 8086 mode, which allows operating systems to effectively divide the 80386DX into several 8086 microprocessors each having its own 1-megabyte space, allowing each “8086” to run its own program."
"HISTORY OF THE MICROPROCESSOR
The first microprocessor was the Intel 4004, produced in 1971. Originally developed for a calculator, and revolutionary for its time, it contained 2,300 transistors on a 4-bit microprocessor that could perform only 60,000 operations per second. The first 8-bit microprocessor was the Intel 8008, developed in 1972 to run computer terminals. The Intel 8008 contained 3,300 transistors. The first truly general-purpose microprocessor, developed in 1974, was the 8-bit Intel 8080 (see Microprocessor, 8080), which contained 4,500 transistors and could execute 200,000 instructions per second. By 1989, 32-bit microprocessors containing 1.2 million transistors and capable of executing 20 million instructions per second had been introduced.
In the 1990s the number of transistors on microprocessors continued to double nearly every 18 months. The rate of change followed an early prediction made by American semiconductor pioneer Gordon Moore. In 1965 Moore predicted that the number of transistors on a computer chip would double every year, a prediction that has come to be known as Moore’s Law. In the mid-1990s chips included the Intel Pentium Pro, containing 5.5 million transistors; the UltraSparc-II, by Sun Microsystems, containing 5.4 million transistors; the PowerPC620, developed jointly by Apple, IBM, and Motorola, containing 7 million transistors; and the Digital Equipment Corporation's Alpha 21164A, containing 9.3 million transistors. By the end of the decade microprocessors contained many millions of transistors, transferred 64 bits of data at once, and performed billions of instructions per second.
Contributed By:
Gary H. Bernstein
© 1993-2003 Microsoft Corporation. All rights reserved."
Re: На
Е, пак съм аз. Изрових нещо по-подредено от обърканите сметки дето ти ги писах по-нагоре:
"Bit (computer), abbreviation for binary digit, the smallest unit of information in a computer. A bit is represented by the numbers 1 and 0, which correspond to the states on and off, true and false, or yes and no.
Bits are the building blocks for all information processing that goes on in digital electronics and computers. Bits actually represent the state of a transistor in the logic circuits of a computer. The number 1 (meaning on, yes, or true) is used to represent a transistor with current flowing through it—essentially a closed switch. The number 0 (meaning off, no, or false) is used to represent a transistor with no current flowing through it—an open switch. All computer information processing can be understood in terms of vast arrays of transistors (3.1 million transistors on the Pentium chip) switching on and off, depending on the bit value they have been assigned.
Bits are usually combined into larger units called bytes. A byte is composed of eight bits. The values that a byte can take on range between 00000000 (0 in decimal notation) and 11111111 (255 in decimal notation). This means that a byte can represent 28 (2 raised to the eighth power) or 256 possible states (0-255). Bytes are combined into groups of 1 to 8 bytes called words. The size of the words used by a computer’s central processing unit (CPU) depends on the bit-processing ability of the CPU. A 32-bit processor, for example, can use words that are up to four bytes long (32 bits).
Computers are often classified by the number of bits they can process at one time, as well as by the number of bits used to represent addresses in their main memory (RAM). Computer graphics are described by the number of bits used to represent pixels (short for picture elements), the smallest identifiable parts of an image. In monochrome images, each pixel is made up of one bit. In 256-color and gray-scale images, each pixel is made up of one byte (eight bits). In true color images, each pixel is made up of at least 24 bits.
The term bit was introduced by John Tukey, an American statistician and early computer scientist. He first used the term in 1946, as a shortened form of the term binary digit."
...
"Byte, in computer science, a unit of information built from bits, the smallest units of information used in computers. Bits have one of two absolute values, either 0 or 1. These bit values physically correspond to whether transistors and other electronic circuitry in a computer are on or off. A byte is usually composed of 8 bits, although bytes composed of 16 bits are also used. See Number Systems.
The particular sequence of bits in the byte encodes a unit of information such as a keyboard character. One byte typically represents a single character such as a number, letter, or symbol. Most computers operate by manipulating groups of 2, 4, or 8 bytes called words.
Software designers use computers and software to combine bytes in complex ways and create meaningful data in the form of text files or binary files (files that contain data to be processed and interpreted by a computer). Bits and bytes are the basis for creating all meaningful information and programs on computers. For example, bits form bytes, which represent characters and can be combined to form words, sentences, paragraphs, and ultimately entire documents.
Bytes are the key unit for measuring quantity of data. Data quantity is commonly measured in kilobytes (1024 bytes), megabytes (1,048,576 bytes), or gigabytes (about 1 billion bytes). A regular, floppy disk normally holds 1.44 megabytes of data, which equates to approximately 1,400,000 keyboard characters, among other types of data. At this storage capacity, a single disk can hold a document approximately 700 pages long, with 2000 characters per page.
The term byte was first used in 1956 by Germanborn American computer scientist Werner Buchholz to prevent confusion with the word bit. He described a byte as a group of bits used to encode a character. The eight-bit byte was created that year and was soon adopted by the computer industry as a standard.
The number of bits used by a computer’s Central Processing Unit (CPU) for addressing information represents one measure of a computer’s speed and power. Computers today often use 16, 32, or 64 bits in groups of 2, 4, and 8 bytes in their addressing."
"Bit (computer), abbreviation for binary digit, the smallest unit of information in a computer. A bit is represented by the numbers 1 and 0, which correspond to the states on and off, true and false, or yes and no.
Bits are the building blocks for all information processing that goes on in digital electronics and computers. Bits actually represent the state of a transistor in the logic circuits of a computer. The number 1 (meaning on, yes, or true) is used to represent a transistor with current flowing through it—essentially a closed switch. The number 0 (meaning off, no, or false) is used to represent a transistor with no current flowing through it—an open switch. All computer information processing can be understood in terms of vast arrays of transistors (3.1 million transistors on the Pentium chip) switching on and off, depending on the bit value they have been assigned.
Bits are usually combined into larger units called bytes. A byte is composed of eight bits. The values that a byte can take on range between 00000000 (0 in decimal notation) and 11111111 (255 in decimal notation). This means that a byte can represent 28 (2 raised to the eighth power) or 256 possible states (0-255). Bytes are combined into groups of 1 to 8 bytes called words. The size of the words used by a computer’s central processing unit (CPU) depends on the bit-processing ability of the CPU. A 32-bit processor, for example, can use words that are up to four bytes long (32 bits).
Computers are often classified by the number of bits they can process at one time, as well as by the number of bits used to represent addresses in their main memory (RAM). Computer graphics are described by the number of bits used to represent pixels (short for picture elements), the smallest identifiable parts of an image. In monochrome images, each pixel is made up of one bit. In 256-color and gray-scale images, each pixel is made up of one byte (eight bits). In true color images, each pixel is made up of at least 24 bits.
The term bit was introduced by John Tukey, an American statistician and early computer scientist. He first used the term in 1946, as a shortened form of the term binary digit."
...
"Byte, in computer science, a unit of information built from bits, the smallest units of information used in computers. Bits have one of two absolute values, either 0 or 1. These bit values physically correspond to whether transistors and other electronic circuitry in a computer are on or off. A byte is usually composed of 8 bits, although bytes composed of 16 bits are also used. See Number Systems.
The particular sequence of bits in the byte encodes a unit of information such as a keyboard character. One byte typically represents a single character such as a number, letter, or symbol. Most computers operate by manipulating groups of 2, 4, or 8 bytes called words.
Software designers use computers and software to combine bytes in complex ways and create meaningful data in the form of text files or binary files (files that contain data to be processed and interpreted by a computer). Bits and bytes are the basis for creating all meaningful information and programs on computers. For example, bits form bytes, which represent characters and can be combined to form words, sentences, paragraphs, and ultimately entire documents.
Bytes are the key unit for measuring quantity of data. Data quantity is commonly measured in kilobytes (1024 bytes), megabytes (1,048,576 bytes), or gigabytes (about 1 billion bytes). A regular, floppy disk normally holds 1.44 megabytes of data, which equates to approximately 1,400,000 keyboard characters, among other types of data. At this storage capacity, a single disk can hold a document approximately 700 pages long, with 2000 characters per page.
The term byte was first used in 1956 by Germanborn American computer scientist Werner Buchholz to prevent confusion with the word bit. He described a byte as a group of bits used to encode a character. The eight-bit byte was created that year and was soon adopted by the computer industry as a standard.
The number of bits used by a computer’s Central Processing Unit (CPU) for addressing information represents one measure of a computer’s speed and power. Computers today often use 16, 32, or 64 bits in groups of 2, 4, and 8 bytes in their addressing."
За Щирлиц
Според мен процесорите се делят на Х-битови заради техните регистри (т.е. колко битoво число можеш да обработиш максимално с 1 инструкция), а не заради системната шина или шината за данни. т.е. можеш да имаш например: 32 битов процесор с 8 битова шина за данни.
В 286 имаше АХ, BX (16 bits), а при 386 имаше EAX, EBX (да не се чете ебе хикс) :-))) -> 32 битови...
При защитения режим на работа (PROTECTED MODE) на процесора адресирането става със сегмент:отместване вътре в 1 сегмент /бил той за данни или за код и т.н. /
Но можеш да адресираш много по голямо пространство, посредством дескрипторните таблици в които се съдържат pointer-и към сегментите ....
Приемам всякакви мнения по въпроса.
Относно калкулатора -> С подходящ софтуер можеш да смяташ колкото си искаш големи числа, а обикновения калкулатор няма такава цел....
Майкрософт може да имат бъг в 64-числовия калкулатор, който ще бъде оправен в SP8 :-))))
В 286 имаше АХ, BX (16 bits), а при 386 имаше EAX, EBX (да не се чете ебе хикс) :-))) -> 32 битови...
При защитения режим на работа (PROTECTED MODE) на процесора адресирането става със сегмент:отместване вътре в 1 сегмент /бил той за данни или за код и т.н. /
Но можеш да адресираш много по голямо пространство, посредством дескрипторните таблици в които се съдържат pointer-и към сегментите ....
Приемам всякакви мнения по въпроса.
Относно калкулатора -> С подходящ софтуер можеш да смяташ колкото си искаш големи числа, а обикновения калкулатор няма такава цел....
Майкрософт може да имат бъг в 64-числовия калкулатор, който ще бъде оправен в SP8 :-))))
Re: На
Мъчи се неуко копеле ,-))))))))
Докато стигнеш до светлината )))))))))
лошото е че тогава ще си кажи речи вече в края на тунела )))))))))))))))
От мен да знаеш ............... за работа в тази светлина .... ))))))
заплата под 3000 euro си е чист подарък от теб към робовладелеца.
Дерзай )))))))))))
Докато стигнеш до светлината )))))))))
лошото е че тогава ще си кажи речи вече в края на тунела )))))))))))))))
От мен да знаеш ............... за работа в тази светлина .... ))))))
заплата под 3000 euro си е чист подарък от теб към робовладелеца.
Дерзай )))))))))))