‘壹’ 使用VIPLE实现奇校验。要求:①通过按键事件输入15位0或1②在Runwindows输出校验位和
摘要 ASU VIPLE,正式称为ASU-VPL,视觉物联网/机器人编程语言环境在
‘贰’ 为什么别人发过来的文件我用Viple打开是空白的 其他人打开是有内容的
之所以别人发过来的文件,你用VIP L1打开是空白的,是因为VIP le不支持这个文件的格式,别人打开有内容是因为它使用的是其他的查看文件的软件。
‘叁’ 用viple将一个十进制的数转化为二进制
#include <stdio.h>
#include <stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
#define LISTINCREMENT 10
#define INFEASIBLE -1
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef int SElemType;
typedef int Status;
typedef int ElemType;
typedef struct SqStack
{
SElemType *base;
SElemType *top;
int stacksize;
}SqStack;
Status InitStack(SqStack &S);
Status Push(SqStack &S,SElemType e);
Status Pop(SqStack &S,SElemType &e);
Status StackEmpty(SqStack S);
void convert(int a);
void main()
{
int n,M,e;
SqStack S;
InitStack(S);
printf("请输入要转换的数字:");
scanf("%d",&n);
M=n;
while(M)
{
Push(S,M % 2);
M = M / 2;
}
printf("转换为二进制数为:");
while(!StackEmpty(S))
{
Pop(S,e);
printf("%d",e);
}
printf("\n");
Status InitStack(SqStack &S)
{
S.base = (SElemType *)malloc(STACK_INIT_SIZE * sizeof(SElemType));
if(!S.base)
exit(OVERFLOW);
S.top = S.base;
S.stacksize=STACK_INIT_SIZE;
return OK;
}
Status Pop(SqStack &S,SElemType &e)
{
if(S.top == S.base)
return ERROR;
e = *--S.top;
return OK;
}
Status Push(SqStack &S,SElemType e)
{
if(S.top - S.base >= S.stacksize)
{
S.base = (ElemType *)realloc(S.base,(S.stacksize + LISTINCREMENT) * sizeof(ElemType));
if(!S.base)
exit(OVERFLOW);
S.top = S.base + S.stacksize;
S.stacksize += STACKINCREMENT;
}
*S.top++ = e;
return OK;
}
Status StackEmpty(SqStack S)
{
if(S.top == S.base)
return OK;
else
return ERROR;
}
void convert(int e)
{
if(e==0)
printf("0");
if(e==1)
printf("1");
}
‘肆’ 怎样用viple实现奇偶校验
怎样用viple实现奇偶校验?因为在数据存取和传送的过程中,由于元器件或者噪音的干扰等原因会出现错误,这个时候我们就需要采取相应的措施,发现并纠正错误,对于错误的检测和校正,大多采取“冗余校验”的思想,即除原数据外,额外增加若干位编码,这些新增的代码称为校验位。